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

  • gordkgordk St.Catherines On. Canada.
    edited 6:59PM
    Assuming the following has already happened
    ....
    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.

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.