TfrxReport.PreviewForm = nil after second preview

edited 8:28PM in FastReport 4.0
Hello

I'm not sure that it is a bug, but when I have such setting in PreviewOption:

Modal := False
MDICHild := True

then when I generate a preview of my report everythink is OK (frxReport.PreviewForm point to PreviewForm), but when I generate another preview to that report (without closing preview) frxReport.PreviewForm equals nil. There is a way out because frxReport.Preview.Owner point to PreviewForm to, but I think that PreviewForm property always shoud Point to Preview Form : )

PS. I'am using only one TfrxReport component for all reports (loading from database), so maybe I sould use some "Clear" method that will remove Preview object from memory before generating nex report?

{...}
procedure TfrxReport.ShowPreparedReport;

var
WndExStyles: Integer;
begin
FPreviewForm := nil; // when I second time call ShowPrepareReport this field i setting to nil and the reference is gone forever
if FPreview <> nil then // but FPreview is not nil, so maybe U should comment 1 line "FPreviewForm := nil;"
begin
FPreview.FReport := Self;
FPreview.FPreviewPages := FPreviewPages;
FPreview.Init;
end
else
begin
FPreviewForm := TfrxPreviewForm.Create(Application);
with TfrxPreviewForm(FPreviewForm) do
begin
{...}

b

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.