cancel
Showing results for 
Search instead for 
Did you mean: 

Application crashing when generating many PDFs using Crystal Report and Thai language

0 Kudos
1,188

We are generating 145,112 PDFs using Crystal Reports in a multi-threaded loop.

After generating about 826 PDFs, our application will crash.

We have isolated the issue to a combination of Thai characters being printed into the report and using the PSL Kittithada Pro font.

Is there some sort of Thai multi-language support required when using Crystal Reports?

View Entire Topic
DellSC
Active Contributor
0 Kudos

First off, I would look at a couple of things that are not related to the language and font....

What language is the application written in - Java, VB.NET, or C#.NET?

If it's either of the .NET languages, is the code ever explicitly calling .dispose() on the ReportDocument instance or is the instance in a "using" clause? If not, that could be at least part of your problem. The .NET SDK is built on a foundation of COM objects which .NET does not memory manage very well so things need to be explicitly disposed or the application's memory use will just keep increasing until all of the memory on the computer is used up.

A couple of other things that negatively affect memory usage are:

1. The use of "TotalPages" or "PageNofM". If these aren't used, Crystal will export each page as it is rendered. If they are used, Crystal has to render ALL of the pages before any of the report can be exported.

2. The use of subreports, especially if they're in a details section.

-Dell

0 Kudos
  1. The application is written in C#.NET.
  2. Yes, the code does explicitly call .Dispose() on the ReportDocument instance. The instance is not in a "using" clause.
  3. We're using a pool of ReportDocument instances that we re-use while creating the PDFs, is this alright in your view?
  4. We have not much of a choice when it comes to sub-reports. We have to use them. Does the advise about reversing the order of setting connection info from this forum still valid?
  5. I tried increasing the value of the PrintJobLimit in the registry to a higher value (ex. 999) but that doesn't fix my problem. Is there some sort of registry setting that I can tweak? The registry setting is:
    [HKEY_LOCAL_MACHINE\SOFTWARE\SAP BusinessObjects\Crystal Reports for .NET
    Framework 4.0\Report Application Server\Server]
DellSC
Active Contributor
0 Kudos

Periodically, you'll want to call

Marshal.ReleaseComObject(reportdocument);

to get the program to release the memory that it's using for the ReportDocument.

Also, you can't really change the Print Job limit for the .NET SDK - it's limited to 100 concurrent print jobs by the runtime license. So, if you're multi-threaded and running multiple reports at the same time, you might run into issues. A "print job" is defined as a main report plus each instance of a subreport within that report. For example, if you have a subreport that only runs in the report header, you have 2 print jobs. However, if you have a subreport that runs in a details section and you have 100 records displayed, you have 101 print jobs, which will fail.

-Dell