Solved

Slow opening of Crystal Reports in .NET Run time

Posted on 2009-04-05
7
8,606 Views
Last Modified: 2012-06-27
Hi all

We have been using Crystal Reports for about  8 years from now. We designed all the the reports in Crystal Reports Ver 8.0

We have our applications running in VB6 . Same crystal reports get opened very fast almost instantly. Crystyal Reports (as comes with Older Visual Studio for VB6) staled along with VB Setup installation. In VB6 application we used to add reference of Crystal Report engine - and gets embedded in the VB6 installation.

Same application we ported it to .NET and we run the Crystal Reports .NET Run time over the client nodes. We use CRRedist2005_x86.msi file (about 16736 kb dt. 10/24/2007) for the Crystal Reports .NET run time installation for our Crystal Reports in VB.net windows application. Crystal Reports are still old which were designed in Crystal Reports 8.0 We purposely dont' shift to later version for the sake of compatibiity.

We find very slow response for opening of the Crystal Report in VB.NET application for the 1st time. It takes approx 20 secs to 40 secs many times for even single page report which would open in just 1 second in Vb6 windows application.. Once it opens up, later the same report would open up almost instanly. This happens with almost majority of the reports. For the 1st time it would take time and in the 2nd time onwards it would open up instantly. If we exit from the system ->Go to VB.Net application again (without shut down) we will get the same irritating behaviour again. This we have tested on many client nodes with very good configuration say 1GB RAM, Pentium Dual Core System.

We think this may be bug in the Crystal Reports .NET Runtime installation file as the same reports with the same logic opens in VB6 application almost instanly each time and every time.

This behaviour is very different in VB.Net application for opening of the Crystal Report.

Can you suggest some remedy for the irritating opening of crystal report (designed in ver 8.0) - opening in VB.net windows application.

Bansal
























0
Comment
Question by:suresh_bansal
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 24071300
This is down to the .NET implementation of Crystal Reports. I face the same problem in my applications. When the report is loaded first time, the CLR has to load dozens of DLLS related to Crystal Reports. Loading and initializing these DLLs takes time. But if you open the report again, these DLLs are already in memory so it loads straight away. When you close the app, the DLLs get unloaded and the behavior is repeated. It really is irritating. In one of my apps, the report is huge on more than 40 pages with links to dozens of pictures, logos etc and it takes many minutes to load each time rather than seconds.
0
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 500 total points
ID: 24071775
I have this message in my inbox but never had time to give it a serious try:

> > Is it possible to preload assemblies before they are called?  Each
> > time the first report in my app runs, it takes 10-15 secs while it
> > loads the appropriate assemblies, after that any report that is run
> > appears immediatly.

> Here you go...

> ' load up crystal when the app starts up.
> ' use a separate thread since its such a pig.
>             TraceWriteLine("starting Crystal Reports Thread")
>             myTimer = New FunctionTimer("load crystal")
>             Dim t As New Thread(AddressOf LoadCrystal)
>             t.Priority = ThreadPriority.BelowNormal
>             t.Start()
>             myTimer.EndTimer()
>             TraceWriteLine("...thread started")


> ' here's the code to load up a dummy report.
> ' this seems to load up and keep everything in memory throughout the
> life of the app.

>     Public Sub LoadCrystal()
>         crReport = New ReportDocument

>         Try
>             ' Need to preload crystal engine so the reports will print
> quickly throughout the rest of the application.
>             ' This report is not used, it is just loaded.  Testing so
> far 12/23/04 has not shown any
>             ' problems such as memory or print errors.
>             crReport.Load(CrystalReportFolder & "rptBlank.rpt")

>         Catch ex As Exception
>             DisplayException(ex, "Error: Could find the startup
> Crystal Report named 'rptBlank.rpt'." & _
>                vbCrLf & "If you are a new user, you may lack Server
> permissions to read this directory and file: " & CrystalReportFolder & 
> "rptBlank.rpt" & _
>                vbCrLf & "Or the report may have been deleted or
> corrupted.  Please Call IT.  [EJS0412311300]")
>         End Try
>     End Sub

0
 
LVL 101

Expert Comment

by:mlmcc
ID: 24083554
That may be the issue.  One other thing to try would be to upgrade/convert a report to the Crystal.Net format to see if that speeds loading.

Crystal will convert the reports to the correct format when it tries to display them.

mlmcc
0
Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

 

Author Comment

by:suresh_bansal
ID: 24094467
Reply to mlmcc

This begaviour is not uniform. Sometimes this takes 10-20 seconds, other time it may take 30-50 seconds for the same report. Next time the same report may be available in just less than 2 seconds.

This behaviour irritates.

As report by emoreau, we also tried to pre-load the Crystal Assemblies at the start of application by opening dummy crystal report but that also did not work.

As regards designing of Crystal Reports with Crystal.net is concerned, it also does not sound perfect as with our existing Rpt files, in 50-60% of the times, it would open in less than 3-4 second.

Some service patck is desired from Seagate for Crystal Reports in .NET to overcome this problem.

We came across Crystal Reports Service Pack 1 from their site, we tried that but without any benefit for this particular problem. They must have corrected some other problems which we did not face.

Kindly let us know, if there is some service pack for Crystal Reports.net to overcome this particular problem of slow opening of the crystal reports.


Regards

Suresh Bansal


 







0
 
LVL 101

Expert Comment

by:mlmcc
ID: 24101552
When applying service packs make sure you get the correct one.  They are version specific.  For example the CR10 service pack doesn't work with the CR in Visual Studio even though it is also CR10.

mlmcc
0
 

Author Closing Comment

by:suresh_bansal
ID: 31566725
Thanks for the sample code for Pre-loading of default crystal assemblies. Solution should work
to some extent.

Bansal

0
 

Expert Comment

by:gcook17
ID: 33456335
The best solution is do not use Crystal reports. I have the same problem. Sometimes reports load very quickly. Other times same report takes a 30 seconds or longer. Tried to used CR2008 Sp 3 but it crashes Installshield Pro.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question