SQL Server and Crystal Report is too Slow

PeymaniuM

Member
Joined
Jul 17, 2006
Messages
22
Programming Experience
1-3
Hi.!
Well thanks to all for helping me to complete my application!
I have a small problem and that is when I install my apllication on anothjer computer everything works fine except that connecting and retrieving data from SQL Server for my Crystal Report Form is too slow!
I dont know what is the problem!
Can someone help me with this small problem!

P.S. I'm using VB.NET 2005, SQL Server Express, Crystal Report!
 
Provide details so people can better assist you. Show code, SQL Queries, how are you accessing data? Dataset, DataReader, ResultSet? Is the data returned excessive? Are you using SELECT * or specifying specific columns? Stored Procedures? A lot is involved, we can only help with what you offer us to help with.
 
Well when i want to open Crystal Report Form for printing and viewing my report, it takes about 45-60 seconds!
-Well for Crystal Report I attach View that show the result from the database!
-For the Database, Im using SQL Server Express Edition
-For my Queries it's just a view to show the result of my report in Crystal Reports.
-The view is not in the dataset and Crystal Report is getting it directly from the Database!
 
Is This Problem Always Happens With Sql Server (express Edition)...!!!
Or Is There Any Other Problem That Makes It Run Slow!
Something Like Hardware (ram, Cpu, ...)
 
I can bet there is something wrong with your reports ... 45-60 seconds is absolutelly not acceptable time.
Btw, i assure you that if you carefully review the displayed report you would notice that something is missing or not correctly computed. Must be! Crystal Reports still using old VB6 error handling manners like On Error Next ..ignoring the exception(s) but again hard trying to fix that error (that's why it is consuming so much time for generating reports.
Check the structure of the tables ... are they matching the structure of ones from the DB of your computer?
 
fpineda101 said:
At the risk of bringing hellfire of this forum upon me, Use Oracle!
I don't think so ... Oracle is one of the top 2 beckends and of course your recommendation is OK but in this concrete case it really doesn't matter. Moreover, to wait 45-60 sec for generating only one report is odd and althrough not usuall even for the worst backends (if there is something like that). I beleive that problem comes from something unforseen like different named field(s) than in the DB on his computer. Means it could be caused by some changes to the data-structure of DB that you have done meanwhile but you have forgoten to verify the same ... tip: always verify DB (applychanges) after you change data-structure. CR is often tricky but when you adjust it ones CR rox.

Regards ;)
 
The problem is that it takes this time only for the firsdt time trying to connect to report!
But after that it's normal!
 
This is my code for connecting to Database before opening the Report!
(To avoid that Database Login Dialog Box)

Private
Sub BindingNavigatorPrintItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BindingNavigatorPrintItem.Click

...
rptLogin(FourSectorTicketsPrint.FourSectorTicketsReport1.Database.Tables)
...

End Sub


Sub
rptLogin(ByVal crTables As Tables)
Dim crConnectionInfo AsNew ConnectionInfo()
Dim CrTable As Table
Dim crtableLogoninfos AsNew TableLogOnInfos()
Dim crtableLogoninfo AsNew TableLogOnInfo()
With crConnectionInfo
.ServerName =
".\SQLEXPRESS"
.DatabaseName = "TicketPrinter"
.UserID = "username"
.Password = "password"
EndWith
ForEach CrTable In crTables
crtableLogoninfo = CrTable.LogOnInfo
crtableLogoninfo.ConnectionInfo = crConnectionInfo
CrTable.ApplyLogOnInfo(crtableLogoninfo)
Next
EndSub
 
Back
Top