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

AV error from TppReport.PrintToDevices;

edited January 2002 in General
I use TppReport.PrintToDevices to update a TppViewer in a form. It works
fine. But sometimes, I will soon afterwards have to destroy the TppReport
component.

The TppViewer seems to be working independently for some time to update
itself, and it will crash with an AV error if I free up the TppReport before
it is finished.

It helps to use TppReport.PageLimitReached before TppReport.destroy.

It helps even more to wait for TppViewer.busy=false.

But I still get the error now and then. Is there a completely safe way to
destroy the TppReport without such problems?
--

Ha en fortsatt hyggelig dag!

Mvh/regards
Svein Olav Mytting
Intelligent Software AS
Bogstadvn 60A, 0366 Oslo
www.IntelligentSoftware.no

Comments

  • edited January 2002
    Be sure to free the report only after the call to Report.PrintToDevices.

    ...
    ppViewer1.Report := ppReport1;
    TppReport(ppViewer1.Report).PassSetting := psOnePass;
    ppViewer1.Report.PrintToDevices;
    ppViewer1.FirstPage;

    if ppReport1.Engine.StopPrinting then
    begin
    ppReport1.Free;
    Close;
    end;
    ...

    Cheers,

    Jim Bennett
    Digital Metaphors


This discussion has been closed.