Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
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:57pm
Suziem446
Edited 12-Apr-10 23:45pm
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 5

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  
Comments
alrajhi20 at 11-May-14 0:15am
   
Would you please send the proper code for initiating it?
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 6

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  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 8

CrystalReportViewer1.Refresh()
 
in this line it will take more time....
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Have you run this under the debugger to see exactly what part of it is slow? Which line is taking the most time?
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

objReport.SetDataSource(dataSet);
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 4

Tom, As I am fairly new to this environment how do a post and run a dummy report?
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 490
1 Prakriti Goyal 302
2 Yogesh Kumar Tyagi 224
3 Maciej Los 185
4 Sergey Alexandrovich Kryukov 167
0 OriginalGriff 6,652
1 Sergey Alexandrovich Kryukov 5,449
2 Maciej Los 3,474
3 Peter Leow 3,303
4 DamithSL 2,505


Advertise | Privacy | Mobile
Web01 | 2.8.140721.1 | Last Updated 28 Sep 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100