Exception when previewing report from designer

edited 8:44PM in FastReport 3.0
I am using FastReport 3.2.21 in Delphi 2006. I have a custom preview window with a TfrxPreview component connected to a TfrxReport. If I open the designer by calling TfrxReport.DesignReport and press the preview button from within the designer I get an exception whenever the custom preview window is redrawn. You can easily see this error in the frDemo program if you change frxReport1.PreviewOptions.Modal to false.
First press the Preview button and resize the preview window so you can see the main window. Next press the Design button and resize the designer so you can see the preview window. Next press the preview button in the designer and resize the designers preview window so the original preview window is visible. You will get an EAccessViolation exception on line 618 of frxPreview.pas any time the original preview window is redrawn by windows. The PreviewPages function call returns a nil pointer.

I assumed from this behavior that the TfrxReport component can only handle one preview at a time. So I tried setting the custom preview component's Report property to nil and setting the reports Preview property to nil before opening the designer window. I still get the exception. To get this to work I finally had to creat a second report component and copy the report via a stream to be able to open the designer with out fear of an exception.

Is there a better way to preview a report from the designer when the report component already has a preview window opened? I suspect that my work around makes inefficient use of memory and processor cycles.

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.