Click here to Skip to main content
Sign Up to vote bad
good
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();
 
            // Change 'OperationalUnitTableAdapter' to appropriate adapter.
            ePAM.Reports.StrategyDataSetTableAdapters.OperationalUnitTableAdapter adapter = new ePAM.Reports.StrategyDataSetTableAdapters.OperationalUnitTableAdapter();
            adapter.Connection.ConnectionString = BusinessLayer.BusinessLayer.GetConnectionString();
            adapter.Fill(dataSet.OperationalUnit);
 
            // Change 'Operational_Units' to appropriate report.
            Reports.Print.Operational_Units objReport = new Reports.Print.Operational_Units();
 
            // Change 'dataSet.OperationalUnit' to 'dataSet.***'.
            objReport.SetDataSource(dataSet);
 
            wnd.MyReportViewer.ReportSource = objReport;
            wnd.MyReportViewer.RefreshReport();
            wnd.ShowDialog();
 
        }
 
Thanks in Advance
 
Suzie
Posted 12 Apr '10 - 22:57
Suziem446
Edited 12 Apr '10 - 23:45


7 solutions

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.
  Permalink  
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.
  Permalink  
Have you run this under the debugger to see exactly what part of it is slow? Which line is taking the most time?
  Permalink  
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.
  Permalink  
objReport.SetDataSource(dataSet);
  Permalink  
Tom, As I am fairly new to this environment how do a post and run a dummy report?
  Permalink  
CrystalReportViewer1.Refresh()
 
in this line it will take more time....
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 Sergey Alexandrovich Kryukov 424
1 Mahesh Bailwal 398
2 Maciej Los 205
3 Aarti Meswania 173
4 Rohan Leuva 165
0 Sergey Alexandrovich Kryukov 9,417
1 OriginalGriff 7,204
2 CPallini 3,933
3 Rohan Leuva 3,211
4 Maciej Los 2,743


Advertise | Privacy | Mobile
Web02 | 2.6.130516.1 | Last Updated 28 Sep 2012
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid