Announcements
 Crystal Reports Forum : General Information : Announcements
Message Icon Topic: Very Slow Crystal Report display Post Reply Post New Topic
Author Message
sharad_memory
Newbie
Newbie
Avatar

Joined: 09 Sep 2009
Location: Nepal
Online Status: Offline
Posts: 2
Quote sharad_memory Replybullet Topic: Very Slow Crystal Report display
    Posted: 09 Sep 2009 at 11:12pm
Hi,
 I am using CrystalReport11-R2 in my application. I have uses A DataTable of Typed Dataset as DataSource. I have used querries in front end the querry returns a DataTable. This DataTable has been added in DataTable of TypedDataSet. Like;
 
ReportDocument rptdmt=new ReportDocument();
string FileName=Application.StartupPath+\\report1.rpt;
rptdmt.Load(FileName);
 
strring querry="Select values from tableName";
DataTable dt=DA.ExecuteDataTable(querry);
 
Myapp.DataSet1.DataTable1 dtReport=new Myapp.DataSet1.DataTable1();
foreach(DataRow dr in dt..Rows)
{
    dtReport.Add(dr.ItemArray);
}
 
rptdmt.SetDataSource(dtReport)
 
crViewer.ReportSource=rptdmt;
 
 
This is pattern of my codeing for displaying report. The data are correctly displayed. My only problem is report is displayed after long time which is very slow in my application. Please advice me how can speed up my report display?
sharadchandra
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 10 Sep 2009 at 9:33am
There are a couple of things that will affect this.
 
1.  The first time that you run a report in your application, all of the Crystal assemblies that are required for processing the report are loaded into memory.  This takes a while and there's not much you can do speed it up other than adding more memory to the workstation where the report is being run.
 
2.  If possible, compile the report into your application rather than loading it from a file.  My experience has been that it takes less time to create a typed object for a specific report than it does to load it from a file.  If you want your users to be able to modify the reports or if you want to be able to distribute report updates without updating the software, you will not be able to do this.
 
3.  Do all of your data filtering in your application BEFORE you set the data source for your report.  When you're working with in-memory data sets, you don't have a database server to do filtering and grouping for you, so Crystal has to read ALL of the data and do the filtering and grouping as it's processing the data, so it takes much longer than having the database do the work.
 
-Dell
IP IP Logged
sharad_memory
Newbie
Newbie
Avatar

Joined: 09 Sep 2009
Location: Nepal
Online Status: Offline
Posts: 2
Quote sharad_memory Replybullet Posted: 10 Sep 2009 at 8:27pm

hilfy,

-yes it may be due to loading of Crsytal Reports Assembly in the time of displaying report first time. I tried to load assemblies in the starting of application and used its object for further time. It worked for one report. If the next report is tried to view without restarting the application the object reference exception is thrown. If new object is created it works.
 
-In my application crystal report need not process any querries. All the datas are filtered in the application. Filtered datas are taken initially in the form of dataTable. This DataTable is just added in Typed DataSets DataTable. In my application there is not relation of Crystal report with database.
 
Still there is delay in displaying report. How to solve this please suggest me.
sharadchandra
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 10 Sep 2009 at 8:52pm
How many rows of data?  Is there more than one table?  If so, how many rows in the joined data?  Is your data already sorted or is Crystal sorting it?  Are you doing any summaries (sum, count, etc.?)
 
To prevent the exception, you need to be sure to explicitly call dtReport.Dispose() when the user is done with the report - usually in the OnClosing event handler of the viewer form, but that depends on your code.  The Crystal assemblies are wrappers around COM objects.  .NET memory management does not work well with COM objects so they always have to be explicitly disposed. 
 
-Dell
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.023 seconds.