on 10-30-2013 10:31 AM
I have a VB.NET program that runs several routines that work fine. They access an SQL database on another machine for add , change, and deletion of records. It also has reports that use the crystal report viewer and calls a crystal report 2011 report on the same machine, accessing the same SQL server (SQL Server 2008R2) and runs it interactively. It is slow as can be when I run the report. Whether I run the application on the users windows 7 machine or on the Server 2012 it is slow to bring up the actual report.
Any suggestion on how I can speed this process up... It is a straight forward piece of code. Here it is....
Public Class frmElimReviewToday
Private Sub CrystalReportViewer1_Load(sender As System.Object, e As System.EventArgs) Handles CrystalReportViewer1.Load
Dim rpt As New CrystalDecisions.CrystalReports.Engine.ReportDocument()
CrystalReportViewer1.ReportSource = rpt
CrystalReportViewer1.ReportSource = rpt
rpt.SetDatabaseLogon(
"xxxx", "xxxx")
End Sub
End
Class
any suggestions are appreciated...
Jim Fulton
Hi Jim,
What version of CR SDK are you using? (as CR 2011 does not ahev a .NEt SDK)?
I assume that you are using CR for VS 2010 for your SDK development, upgrade to SP7.
http://scn.sap.com/docs/DOC-7824
Could you try this sample code.
ReportDocument rd = new ReprotDocument();
rd.load("report.rpt");
rd.setdatabaselogon("server","db","user","password");
CRViewer1.reportsource= rd;
While running the code keep a check on SQL DB and see how much time does the SQL query take to get the data (use SQL profiler may be).
- Bhushan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Great.
It has been obeserved that on first load the performance is slightly slow, because the app loads CR DLLs, DB driver etc etc.
Run process Monitor on first load and you will see the things it loads.
So to improve the eprformance on first load see belo doc.
- Bhushan
nope... still crawling...not sure what else to do.. it does eventually load however it take approx. 1 min. just to load the report and run it. Even when I am running it directly from the development server where the software and the report resides. Server is a 2012 server 64 bit processor with 4GB of ram.
Jim
The time lag is due to the fact that the Crystal assemblies all have to be loaded into memory.
To prove this, I would do the following:
1. Run a report.
2. Wait for everything to load and the report to appear.
3. Run another report.
I suspect the second report will appear MUCH more quickly than the first one because the assemblies are already loaded.
Also, Crystal can be a memory hog. I suspect that with only 4GB of RAM, there is a lot of swapping from memory to disk. This will also slow things down. So, one of the biggest things you can do to alleviate this issue would be to add more RAM to the server. I would have at least 8GB, although 16GB would be better.
-Dell
Hello James
I'm dubious that adding RAM will help much on the first report load. But it will be interesting to see what diff you do see.
Most recommended way around this is to load a dummy report on app load (e.g.; start of the exe / process). In this way, the report load time becomes part of the initial app load time. The time is still there, just moved to another place.
- Ludek
Senior Support Engineer AGS Product Support, Global Support Center Canada
Follow us on Twitter
Got Enhancement ideas? Try the SAP Idea Place
I have upped the ram to 16gb but it is still slow to load even running from the server where it is based.. The problem I have is he runs this program once a day. He logs in to the system, brings up the program and runs the report to review the data before he does any data base changes. And that is it. Its does work faster when I have run the report more then once and keep the program running but that is not the case normally. Its is normally a one time shot once a day...
Jim
User | Count |
---|---|
83 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.