How to free a report when done?
How do I free a report after previewing it with the viewer? I set a
breakpoint in my ReportAfterPrint event and it never gets called. I think
I'm leaking memory (or at least not freeing the last preview) because I
don't know how to stop the report once the user is done previewing. My
viewer just shows up on a form that has other components on it. I'm not
using the standard previewer or a custom descendant.
breakpoint in my ReportAfterPrint event and it never gets called. I think
I'm leaking memory (or at least not freeing the last preview) because I
don't know how to stop the report once the user is done previewing. My
viewer just shows up on a form that has other components on it. I'm not
using the standard previewer or a custom descendant.
This discussion has been closed.
Comments
after the call to PrintToDevices.
...
ppReport1.PrintToDevices;
if ppReport1.Engine.StopPrinting then
ppReport1.Free;
...
Report.AfterPrint event
Description
This event fires after the print process has been completed. When printing
to the printer or to the file, AfterPrint fires after the print job has been
closed or after the file has been closed. When printing to the screen,
AfterPrint fires after the Print Preview form has been closed.
Note: BeforePrint, AfterPrint, and OnPrintingComplete fire only when the
Print method is used to print the report.
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com