TfrxReport.PreviewForm = nil after second preview
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
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