Hi All
I'm trying to give my users the ability to display (and print) previously
run and saved Quick Reports (ie .QRP files).
I must admit that (among other things) the structure of QuickReports
has been a considerable mystery to me.
I have managed to get a Preview screen loaded with a saved report and
displayed. I can resize and navigate the pages of the report OK but
when I close the Preview I get an AV.
I'd appreciate some help. It must be something to do with not properly
freeing something.
Below is what I have done.
I have created a PreviewFm form and placed a TQuickRep component
(QR1) on this form. The AfterPreview event contains just a "Close"
statement.
In my app I have the following procedure:
procedure HandleViewReportsClick; //mh 2003-06-10
begin
MainForm.OpenDialog.Filter := 'Report Files, *.qrp|*.QRP';
MainForm.OpenDialog.Title := 'Select file to view';
MainForm.OpenDialog.InitialDir :=
ExtractFileDir(Application.ExeName);
if MainForm.OpenDialog.Execute then try
Application.CreateForm(TPreviewFm, PreviewFm);
PreviewFm.QR1.Prepare;
try
PreviewFm.QR1.QRPrinter.Load(MainForm.OpenDialog.FileName);
PreviewFm.QR1.QRPrinter.Preview;
finally
PreviewFm.QR1.Free;
end;
finally
PreviewFm.free;
end
end;
Any help greatly appreciated
Mark
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED]
with body of "unsubscribe delphi"
Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/