cancel
Showing results for 
Search instead for 
Did you mean: 

Running Crystal From Visual Studio 2010 Performance Issues

Former Member
0 Kudos

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()


        rpt.Load(\\vmhb-develop\Crystal Reports\Programming Reports\SQL Current Days Eliminations Production Report.r...)

        CrystalReportViewer1.ReportSource = rpt

        CrystalReportViewer1.ReportSource = rpt


        rpt.SetDatabaseLogon(

"xxxx", "xxxx")


   

End Sub



End

Class

any suggestions are appreciated...

Jim Fulton

Accepted Solutions (1)

Accepted Solutions (1)

former_member188030
Active Contributor
0 Kudos

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

Former Member
0 Kudos

Yes using the latest SP7. checking the access time it is fast... not a problem there. The problem appears when loading in the actual Crystal Report from the system and bringing it up. Once up and running it is fast.

former_member188030
Active Contributor
0 Kudos

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.

http://search.sap.com/notes?id=0001439745&boj=/sap/bc/bsp/spn/scn_bosap/notes.do?access=69765F6D6F64...

- Bhushan

Former Member
0 Kudos

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

DellSC
Active Contributor
0 Kudos

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

Former Member
0 Kudos

Your right... running the report then running the second report is quicker.. I will try adding 16GB of Ram and let you know...

Jim

former_member183750
Active Contributor
0 Kudos

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

Share Your Knowledge in SCN Topic Spaces

DellSC
Active Contributor
0 Kudos

Ludek,

The load will be faster if the OS does not have to swap out to disk.  4GB is barely enough to run the operating system, so I suspect there's a lot of swapping going on.

-Dell

former_member183750
Active Contributor
0 Kudos

Could be. It will be a very intersting test

- Ludek

Former Member
0 Kudos

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

former_member183750
Active Contributor
0 Kudos

Yeah. The slow load on 1st report is an expected behavior. There is a lot of files being loaded and a number of configurations, etc., etc., to be done before the report can be launched.

- Ludek

Former Member
0 Kudos

Guess I need to live with the slowness, since it is a one time shot...

Thanks anyway guys. I appreciate the help..

Jim

Answers (0)