Clear preview control (TfrxPreview)

edited 10:22PM in FastReport 3.0
How do I clear the preview control ?

I have a situation where I am giving the user to switch between reports while a preview is visible. During the switch, the old report is still visible. I would like to clear the old report from the preview before switching to the new report.

I have tried the following, but get access violations:

frxPreview.Clear
frxPreview.Report.Clear
frxPreview.Report.Free

Can anyone help ?

Thanks,
Darren

Comments

  • edited 10:22PM
    When you want to clear, try that:
    frxPreview.Report := Nil;

    And when you load a new report:
    frxPreview.Report := frxReport;

    Btw, I think the access violation you got is because you destroied frxReport, and later, you tried to access it without recreating...

    regards.

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.