Skip to Content
0
Sep 11, 2016 at 06:33 PM

Out of Memory Exception

206 Views

Don, So I have been working more on this issue and have narrowed it down. The project you have with the images not showing up will work. I only sent 20 images or so with that project you just need to use the same images over and over in the report. I have a report that is 1000 images and it shows in the viewer just fine. I have to set the CyrstalReportViewer.CachePageNumberPerDoc=1 to get it to work but it works. I can page through all 1000 pages just fine. If I set the CachePageNumberPerDoc to anything but 1 it throws an out of memory exception. So when I go to print this report it throws and out of memory exception. I am using the PrintToPrinter method built into the viewer. I have changed the print controller to the PrintOutputController and it prints a few more pages but still throws an out of memory exception. I have changed the printer to the XPS writer and it still throws the exception. That means no printer drivers involved .Net or otherwise. It has something to do with the viewer not working as well unless I set the CachePageNumberPerDoc. It throws the same error the exact same way when printing. Please keep in mind I have even used the PDF writing in windows 10, no print drivers. This issue has to do with all these images and not disposing of them as they are spooled to the print controller. I really need this fixed before the next service pack. This is the same issue I started this time last year. Please pass it on to development. By the way if I print this report from Crystal Reports it works just fine with no problems and it doesn't matter if I am using printers or the XPS, PDF writers. The print drivers out of memory is not the issue because this out of memory error is a .NET System.Drawing exception and throws it back to the viewer. Thanks Chris