1
votes

I've got a C# application targeting .net 4. The application includes some Crystal Reports reports which can be printed or previewed. My code uses:

CrystalDecisions.CrystalReports.Engine.ReportClass

There is a report, created with Crystal 2008, which dynamically fetches one or more images from the file system. I'm running into problems when those images are large.

For example:

  • The report is trying to include 4 images (each on their own page)
  • The source images (.jpgs) are 3.5 megs each

When I print or preview that report, generally the first 2 images appear, but then no more. Then if I try again I generally will not see any of the images and often get this message box (when previewing):

Crystal Reports Windows Forms Viewer

Memory full.

Not enough memory for operation.

My application is using about 600 megs at that point.

If I swap out those large images for smaller ones (about half a meg each) I'm able to view the report without any problems.

If I preview the same report, with the big images, from within the Crystal Reports 2008 editor, it works perfectly well.

So is there a limit to how many megs of image data I can put into a report when using CrystalDecisions.CrystalReports.Engine.ReportClass? Or am I doing something wrong?

1
Are you using .Close and .Dispose on your report objects once you are done with them?Alec.
@Telexx: Yes, I'm calling Close and Dispose. And I see this "memory full" error on the very first time I do the report, so it's definitely not a problem of lost resources from previous reports. But thanks.Jeff Roe

1 Answers

2
votes

Had the same issue with reports containing more than 3 images. Solved by changing a setting in the RPT file. Open your Crystal template, go into File -> Report Options, and unflag the "Retain Original Image Color Depth". This will show pictures with a reduced quality, but will never make the report fail because of "Memory full". At least, that was my case.