on 10-15-2019 12:47 AM
save-or-email.pngHello,
We need advise on the below please :
I am using Window Form based application and Crystal Report for reporting part.
So as soon as open the report ,it opens in the report viewer.
And when we click save button or email the attached error is shown. (Not enough memory for Operation)
So question here is -
1. Could you please explain what is the relation between Crystal Report and system's %TEMP% folder. What objects it accumulates in the temporary folder of the system.?
2. Is the Crystal Report has certain memory limit where it accumulates in TEMP folder of the system and finally it does not allow further?
Please help or advise on the same.
Thanks.
Regards,
Abhilash
Crystal doesn't use the Windows disk swap space, it uses its own swap for each report. This goes in the TEMP folder. If you don't call ReportDocument.Close() and ReportDocument.Dispose(), Crystal doesn't clean up the files in this folder. The trick is that you cannot call those until the user is finished with the report. I usually put them in the OnFormClose event handler for the form where the Crystal Viewer is located.
Also, deep inside the Crystal SDK are a series of COM components. Unfortunately, .NET does NOT memory manage COM components very well, so you do need to call GC.Collect() after disposing of the ReportDocument.
Crystal also doesn't always clear out the temp files if there is an error that prevents the report from running correctly.
The trick to lightening the memory load in Crystal is to push as much of the data processing as possible to the database.
1. Turn on "Use Indexes or Server for Speed" under File >> Options >>Database, which covers all new reports. Also turn it on under File >> Report Options to cover the report you're currently working with.
2. Don't use Crystal functions in the Select Expert. With the exception of "IsNull()", these generally cannot be pushed to the database for processing. Instead, Crystal will bring all of the data into memory and filter it there. If I'm using tables for the report (instead of a command), I will frequently find a way to use a SQL Expression instead of a Crystal function if I'm going to need the value for filtering data - this way it gets pushed to the database for processing.
3. Don't combine multiple commands or stored procedures in a single report. Also, don't combine either a command or a stored proc with tables in a report. Thirdly, avoid combining tables from multiple databases in a report. All of these will cause Crystal to pull all of the data into memory and then do the joins there instead of pushing the joins to the database.
4. If your report is just going to show summary data, but it's aggregating over more than 1,000 or so rows, consider using a command to do the aggregation in the database instead of having Crystal do it in memory. For more information about using commands see my blog post here: Best Practices When Using Commands with Crystal... SCN.
Crystal will use as much memory as is available before swapping to disk. Then it can use as much disk as is available in the TEMP folder.
-Dell
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.