Home Devices
New Blog Posts: Merging Reports - Part 1 and Part 2

Print to file causes memory leaks

edited March 2008 in Devices
Hi,

I got a problem need to be fixed. Please help me.

After print a report which have a lot images to a file, the memory hold by
the program keeps in a high level after a little bit drop.

If I print the report repeat, the memory hold by the program keeps going up
until an error message shown up. I have even tried to make the image picture
= nil after printing, but that not help. However if images in the report are
not assigned before printing the report, the memory will keep low.

Could you please tell me how I can free the memory after print the report to
a file to make it as low as before printing?

Thanks

Comments

  • edited March 2008
    Hi Lianfeng,

    Please specify which version of ReportBuilder and Delphi you are using as
    well as some more specifics on your application. Which device are you using
    to export your report to file?

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited March 2008
    Sorry, I use D2005 & "ReportBuilder for Delphi 2005, Standard Edition"
    Version 10.07 and also TExtraDevices 2.97.

    The code to print the report as following:

    with rpt do
    begin
    DeviceType := 'PDFFile';
    AllowPrintToFile := True;
    ShowPrintDialog := false;
    ShowAutoSearchDialog :=false;
    ShowCancelDialog := false;
    Print;
    end;

    This report have some images inside, before printing, pictures were loaded.
    I check the memory usage via Windows Task Manager. After printing each time,
    the program 'Mem Usage' is increased by 2 - 3 MB.



  • edited March 2008
    Hi Lianfeng,

    Thanks for the information.

    Checking the Windows Task Manager is not always a valid way to check the
    memory usage of an appliction. I would suggest using a memory manager such
    as FastMM or AQTime.

    Have you tried using the built-in PDF device included with ReportBuilder?
    Perhaps this will give you better results.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited March 2008
    Thanks,

    By using FastMM, I found the code which causing memory leak. It is not a RB
    or TXtraDevice problem.


This discussion has been closed.