Export to PDF: Out of memory Error

edited 3:19PM in FastReport 4.0
I have a large report, i know it is a bit weird but i have to implement it, the report has ~ 25.000 pages and it opens in preview mode. But when i try to export it to PDF, that's the way we want to present all the reports in our application, i get an Out of memory Error, or an access violation (null pointer).
I noticed that it always throws the error at ~18.000. (18.687,18.689)
Is this machine specific, i have 4GB RAM and lots of free space on my hard drive
The process takes ~ 1.869.328 K,
RAM is used ~ 3,2 GB overall so this is not the problem.

UseFileCache is set True,
I ve set MaxMemSize to 20, no difference,
I ve tryed to set DataOnly on the TfrxPDFExport-er to true, no difference
The design is totaly minimalistic...


Is there anything else i can do, to get this large report exported, or do i have to split it in smaller pieces, but we don't want to do that.

thanks, Jan

Comments

  • edited 3:19PM
    No ideas, how to get this done with Fast Reports?
    Did no one had a similar problem?
    Does anybody know a way to create very large reports in delphi, with the possibility to export to pdf?

    thx, Jan
  • edited January 2012
    Hello,
    There is a memory leak in frxUtils.DrawBitmap procedure.
    DeleteDC is missing from the end of the procedure.

    The corrected version:
    { Draw with smooth }
    procedure DrawBitmap(aHandle: HDC; Dest: TRect; Bitmap: TBitmap);
    var
      hMemDC: HDC;
      PrevStretchBltMode: Integer;
    begin
      hMemDC := CreateCompatibleDC(aHandle);
      try
        SelectObject(hMemDC, Bitmap.Handle);
        PrevStretchBltMode := SetStretchBltMode(aHandle, STRETCH_HALFTONE);
        with Dest do
          StretchBlt(aHandle, Left, Top, Right - Left, Bottom - Top, hMemDC,
                0, 0, Bitmap.Width, Bitmap.Height, SRCCOPY);
        SetStretchBltMode(aHandle, PrevStretchBltMode);
      finally
        DeleteDC(hMemDC);
      end;
    end;
    
  • gpigpi
    edited 3:19PM
    wrote:
    DeleteDC is missing from the end of the procedure.
    This procedure fixed. Use latest FR 4.12.1
  • edited 3:19PM
    Thanks.
  • edited 3:19PM
    Is this fix in the demo version FastReport 4 for Embarcadero RAD Studio (Delphi/C++Builder) 2010 Oct 31, 2011 ?
  • edited 3:19PM
    i am testing fastrwports with
    FastReports 4 Ebarcadero Edition (4.11.17) and Fast Reports 4 (Demo version 4.11.17)
    as far as i know there are no sources included in this releases, is there a way i can test your solution with DeleteDC for our problem?
    If we can export reports that are about 25000-30000 pages to PDF (on 32 bit) with FastReports we will buy your components.

    Please let me know if there is a way to test this fix?

    thx Jan

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.