Crystal Report loading is very slow when working in a different database than the report file

I am using Crystal Reports 2008 SP2 with a C # .NET 4.0 application. In the application, we load Crystal Reports using this Load method in ReportDocument:

CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(fileName); 

This works great when the database name embedded in the report is available, but when it does not work (for example, it works in production or UAT, where the database names are different), this loading method is very slow. I think this is because Crystal is trying to validate the report (or something similar) in the database embedded in the report.

Is there a way to disable this behavior in Crystal or change the report so that the database name is not embedded in it?

Thanks!

+4
source share
2 answers

Crystal reports take a long time to load their DLLs the first time you invoke a report. What SAP offers to download a dummy report at the first presentation of the application, using a thread or a background worker to get DLLs when you call your product reports.
Hope this helps.

0
source

This is probably the result of a number of effects. Firstly, preloading the DLL will help, but only for the first report. If lag remains a problem after entering the dll preload, it is likely that the lag is caused by the dlls having to make sure that the database schema you are connecting to matches the original database. This “should” only happen the first time you start with a new database, so it can help to pre-run some reports against the new database to make sure that they know that the data dictionaries are checked. CR is not really all that buggy contrary to popular belief, it's just freaky!

0
source

Source: https://habr.com/ru/post/1369231/


All Articles