On 10 Jun 2003 at 13:10, Jeremy North wrote:
> I would use this. You have to use _PreviewModal_ in this instance.
>
> if opendialog1.execute then
> begin
> QuickReport1 := TQuickReport1.Create(self);
> try
> QuickReport1.Prepare;
> QuickReport1.QRPrinter.Load(opendialog1.filename);
> QuickReport1.QRPrinter.PreviewModal;
> finally
> QuickReport1.Free;
> end;
> end;
>
To get this to work it seems that I would have to put a TQuickRep
component on the main for of the application, (which I don't want to
do). How would I modify this so that I could use a TQuickRep
component on another form? (yeah - I know, I should know this stuff by
now!)
Mark
> [EMAIL PROTECTED] wrote on 10/06/2003 12:41:17 PM:
>
> > On 10 Jun 2003 at 12:19, Jeremy North wrote:
> >
> > > Any reason you are creating this dialog with application as
> > > parent? I remember some issue with temp path's being too long
> > > causing errors. This might be it.
> > Not sure I understand what you are saying. I have copied the target
> > .QRP file to the root level on my D:drive and get the same error.
> > >
> > > Anything in the destroy/free of the form you are creating?
> > >
> > > Hanging try..finally block..............
> > There is now NO code in the created form (after removing the Close
> > as suggested by James) Mark
> > >
> > > JED
> > >
> > > [EMAIL PROTECTED] wrote on 10/06/2003 12:04:21 PM:
> > >
> > > > > > 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.FileN
> > > > > > ame) ; PreviewFm.QR1.QRPrinter.Preview;
> > > > > > finally
> > > > > > PreviewFm.QR1.Free;
> > > > > > end;
> > > > > > finally
> > > > > > PreviewFm.free;
> > > > > > end
> > > > > > end;
> > > > > >
> > > > > > Any help greatly appreciated
> > > > > >
> > > > > > Mark
> > >
> > >
> > >
> > > This email and any files transmitted with it are confidential and
> > > intended solely for the use of the individual or entity to whom
> > > they are addressed. If you have received this email in error
> > > please notify the [EMAIL PROTECTED]
> > >
> > > ------------------------------------------------------------------
> > > ---- -----
> > > 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/
> > >
> >
> >
> >
> ----------------------------------------------------------------------
> ----- > 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/
>
> ----------------------------------------------------------------------
> -----
> 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/
>
---------------------------------------------------------------------------
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/