Images won't load after random pages
I have a problem with my report.
My report is using 2 templates, 1 template for first and last page and a second template that is printed X number of times based on datatable rows.
The second report template has 2 pages and 1 image on each page.
After some pages , usually after aprox 20-25 pages the images stop loading and a red cross is shown on their place. The report's text is printing through.
i have tried using the images embedded in the report template or loading them external with no luck.
At the report preview i cannot export to pdf because images are corrupted, here the exception message
"System.ArgumentException: Parameter is not valid.
at System.Drawing.Bitmap..ctor(Int32 width, Int32 height, PixelFormat format)
at FastReport.Export.Pdf.PDFExport.AddPictureObject(ReportComponentBase obj, Boolean drawBorder, Int32 quality, StringBuilder sb_in)
at FastReport.Export.Pdf.PDFExport.ExportObj(Base c)
at FastReport.Export.Pdf.PDFExport.ExportBand(Base band)
at FastReport.Export.ExportBase.ExportPageNew(Int32 pageNo)
at FastReport.Export.ExportBase.Export(Report report, Stream stream)
at FastReport.Export.ExportBase.Export(Report report, String fileName)
at FastReport.Export.ExportBase.Export(Report report)
at FastReport.Preview.PreviewControl.Export_Click(Object sender, EventArgs e)"
i have uploaded some sample pics here.
Fastreport Version 2017.1.2
http://www30.zippyshare.com/v/7cqNn3uI/file.html
My report is using 2 templates, 1 template for first and last page and a second template that is printed X number of times based on datatable rows.
The second report template has 2 pages and 1 image on each page.
After some pages , usually after aprox 20-25 pages the images stop loading and a red cross is shown on their place. The report's text is printing through.
i have tried using the images embedded in the report template or loading them external with no luck.
At the report preview i cannot export to pdf because images are corrupted, here the exception message
"System.ArgumentException: Parameter is not valid.
at System.Drawing.Bitmap..ctor(Int32 width, Int32 height, PixelFormat format)
at FastReport.Export.Pdf.PDFExport.AddPictureObject(ReportComponentBase obj, Boolean drawBorder, Int32 quality, StringBuilder sb_in)
at FastReport.Export.Pdf.PDFExport.ExportObj(Base c)
at FastReport.Export.Pdf.PDFExport.ExportBand(Base band)
at FastReport.Export.ExportBase.ExportPageNew(Int32 pageNo)
at FastReport.Export.ExportBase.Export(Report report, Stream stream)
at FastReport.Export.ExportBase.Export(Report report, String fileName)
at FastReport.Export.ExportBase.Export(Report report)
at FastReport.Preview.PreviewControl.Export_Click(Object sender, EventArgs e)"
i have uploaded some sample pics here.
Fastreport Version 2017.1.2
http://www30.zippyshare.com/v/7cqNn3uI/file.html
Comments
it happened to me because i used big pictures in size and i've printed them many times. so report thrown an exception with the images.
i am waiting for a solution, perhaps a new version?
and also :
http://stackoverflow.com/questions/3654491...alled-regularly
The garbage collector have specific way of collecting objects. images are external resources so they need to be disposed after use. if you dont dispose them its not the garbage collector's problem, its a memory leak from bad code. When creating the template i always dispose the memory stream after use and the images.
i've now found that even if the print preview goes well, if memory reach limits after preview and i try to export to pdf i get an out of memory exception from fastreport. As a temporary solution i've resized the images so it takes more pages to fill memory.
i am still waiting a response from fastreport support and got nothing. (i got an open ticket.)