Memory usage when compiling large reports (PreviewPages.AddFrom and PrepareReport)

edited November 2023 in FastReport VCL

I have a project where a single report is created by looping through our customer table and for each customer:

  • Populate a dataset with customer transactional information
  • Call PrepareReport(false) to append the information for this customer to the report

Each time we call PrepareReport(false) the time taken to complete the process increases which blows the reporting process out drastically.

To overcome this I have attempted to implement a method where there are two TfrmReport objects.

Each customer's data is passed to PrepareReport(true) on TfrxReport number 1, and then I use PreviewPages.AddFrom to append to the main TfrmReport.

This works well and fixes the speed issue. However, it re-introduces another issue experienced previously with FastReports where the memory usage would run away until an 'Out of memory' errors.

This was corrected previously by setting EngineOptions.UseFileCache := True; and PreviewOptions.PictureCacheInFile := True;

Does anyone have an example of how this kind of operation can be completed efficiently without excessive memory usage?


This issue exists in both Delphi 2006 and Delphi 10.4

Comments

  • Does anyone have an example of how this kind of operation can be completed efficiently without excessive memory usage?

    No, FR doesn't have other features. Create 64-bit application to prevent 'Out of memory' errors

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.