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

Report preview is consuming GDI resources and not releasing

edited September 2001 in General
Hi,

We are using Reportbuilder 5.5, Delphi 5.1 C/S.

We have a simple reporting system where the user will automatically open
a previewer when clicking on a report entry. The report previewer is a
descendant of TppCustomPreviewer.

The actual TppReport component is located on a TForm that isn't visible.
To preview a report we use the following code

procedure LoadReport(const reportfile : string);
begin
with Tfrm_Shared_ReportForm.Create(Application) do begin
LoadReport(reportfile);
end;
end;


Tfrm_Shared_ReportForm.LoadReport(const reportfile : string);
begin
...
report.Print;
end;

procedure Tfrm_Shared_ReportForm.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
action := CaFree;
end;


When following the GDI resources used in a Win98 system, I see that with
every preview of a report the resources go up and when I close the
preview these resources are not being released. I know that I am missing
something but not sure what. I'm acutally wondering where the
Tfrm_Shared_ReportForm is being closed.


regards
Paul Sjoerdsma

Comments

  • edited September 2001
    Is the form ever closed? I see where report.Print is called and OnClose is
    coded with a caFree, but where is the Release or Free call on the form
    object?

    -
    --
    Tom Ollar
    Digital Metaphors Corporation
  • edited September 2001
    Tom,

    I have an event handler attached to
    OnPreviewFormClose where I close the report form

    procedure Tfrm_Shared_ReportForm.ppr_SingleReportPreviewFormClose
    (Sender: TObject);
    begin
    DoPreviewFormCloses; // this will call close for the report form
    end;{ Tfrm_Shared_ReportForm .ppr_SingleReportPreviewFormClose() }

    regards
    Paul


    In article <8EAE82296ACCD311A039005004E0CAC004FFC9@DMSERVER>,
    tom@digital-metaphors.com says...
This discussion has been closed.