Terminating frxPreview
I know it is a stupid question, but I can not figure it out myself:
After the Preview window was opened (by Delphi), I would like
to force-close it from Delphi (in case some serial data needs to
be displayed and saved to disk).
Assuming the following has already happened
....
frxReport.PrepareReport;
frxReport.ShowPreparedReport;
....
and the preview window is open (modal, no MDI), I would like
to have an "EventHandler" like this:
procedure TForm.EventHandler(Sender: TObject);
begin
frxReport.PreView.Close / Destroy / Terminate .... ????
... do other stuff ....
end;
Whatever procedure I did call (with PreViewForm. Pages, ...),
I got "Access violation". I guess I do not understand correctly
which is the form which is open (preview window) and needs
to be closed, right?
Thank You!
Comments
....
frxReport.PrepareReport;
frxReport.ShowPreparedReport;
// you are no longer in delphi you are now in the report the preview is the active window
and you will not return to delphi until the previewwindow is closed or code in the report
terminates the report.
// now you are back to delphi
but the report has finished and the preview pages have been destroyed,
so any call to the previewpages will result in an acess violation.