Slow opening of Crystal Reports in .NET Run time

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
























suresh_bansalAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
Éric MoreauConnect With a Mentor Senior .Net ConsultantCommented:
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
 
CodeCruiserCommented:
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
 
mlmccCommented:
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
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
suresh_bansalAuthor Commented:
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
 
mlmccCommented:
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
 
suresh_bansalAuthor Commented:
Thanks for the sample code for Pre-loading of default crystal assemblies. Solution should work
to some extent.

Bansal

0
 
gcook17Commented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.