My Crystal Reports take forever to load in my application - at least 2 minutes: This is my code. What do I do wrong?
private void button1p_Click(object sender, RoutedEventArgs e)
Windows.CrystalReportViewerWindow wnd = new ePAM.Windows.CrystalReportViewerWindow();
ePAM.Reports.StrategyDataSetTableAdapters.OperationalUnitTableAdapter adapter = new ePAM.Reports.StrategyDataSetTableAdapters.OperationalUnitTableAdapter();
adapter.Connection.ConnectionString = BusinessLayer.BusinessLayer.GetConnectionString();
Reports.Print.Operational_Units objReport = new Reports.Print.Operational_Units();
wnd.MyReportViewer.ReportSource = objReport;
Thanks in Advance
12 Apr '10 - 22:57
12 Apr '10 - 23:45
Basically you just create a empty report and open it (no need to set data source or anything you just initiate it)
This will load the crystal reports framework into memory and should cut down loading time drastically.
Check if the second time you open a crystal report is still loading as slow.
Crystal reports is very very slow on the loading for the first time but should be fast when loading the report (or a different one) for a second time (without closing the application)
If it's the case that it is only for the first time then I suggest that you load a dummy report (in the background on a different thread) when loading your application, without showing the report of course.
12 Apr '10 - 23:49
Have you run this under the debugger to see exactly what part of it is slow? Which line is taking the most time?
12 Apr '10 - 23:49
basically when you run first time it always slow because opening and loading database is slow. from second time onwards it will become faster. to check create a empty crystal report and run it. you will see it is faster than the database connected crystal report.
Tom, As I am fairly new to this environment how do a post and run a dummy report?
in this line it will take more time....
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)