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

Comments

  • edited 11:00AM
    just for curiosity, do you put image as watermark or picture in overlay section? a red cross with dimension of page size.
  • edited 11:00AM
    ipong wrote: »
    just for curiosity, do you put image as watermark or picture in overlay section? a red cross with dimension of page size.
    The image is used in overlay, it has the dimensions of an A4 paper and in front of the picture i print some text in specific areas.
  • edited 11:00AM
    I found that its a memory leak from fastreport.dll.
    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?
  • edited 11:00AM
    i think the problem lies on dotnet garbage collector. the same problem happens on latest release of fastreport mono (not 2014 release). [img]style_emoticons/<#EMO_DIR#>/mad.gif" style="vertical-align:middle" emoid=":angry:" border="0" alt="mad.gif" /> read[/img] http://stackoverflow.com/questions/5838608...-no-memory-left

    and also :
    http://stackoverflow.com/questions/3654491...alled-regularly


  • edited 11:00AM
    ipong wrote: »
    i think the problem lies on dotnet garbage collector. the same problem happens on latest release of fastreport mono (not 2014 release). [img]style_emoticons/<#EMO_DIR#>/mad.gif" style="vertical-align:middle" emoid=":angry:" border="0" alt="mad.gif" /> read[/img] http://stackoverflow.com/questions/5838608...-no-memory-left

    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.)

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.