Just a thought (since I don't use QR myself) but are you sure the Access
Violation is a result of QR ?
Is it possible that it happens earlier in your code ?? It might be worth
stepping through it, as the fact that you always seem to get an AV when
running a QReport just rings a few of those "debugging" alarm bells to me.
In my experience, AVs normally happen because either:
1) I forgot to create an object before I used it, or
2) I'm calling a method of a form which hasn't been created yet (eg: in the
OnCreate event of a form which was created earlier in the AutoCreate list).
OTOH, maybe QR is full of bugs :-)
Hope this helps,
Simon.
----- Original Message -----
From: Mark Howard <[EMAIL PROTECTED]>
To: Multiple recipients of list delphi <[EMAIL PROTECTED]>
Sent: 02 February, 2000 9:18 AM
Subject: [DUG]: Quick Report Preview
> Hi
>
> I am trying to merely display some previously run reports, saved
> in .QRP format. (Using QR V2)
>
> I have done the following:
>
> procedure TMain.OwnDetBtnClick(Sender: TObject);
> var RepName: String;
> begin
> if Sender = BitBtn1 then RepName := 'OwnDet';
> (some more of this)
> end;
>
> with ReportFrm do
> begin
> QR1.Prepare;
> QR1.QRPrinter.Load('Reports\'+RepName+'.QRP');
> QR1.QRPrinter.Preview;
> QR1.QRPrinter.Free;
> end;
> end;
>
> which works fine - except the report displays at about 150% size,
> and when I click on any of the "size" buttons I get an Access
> Violation error.
>
> Patrick suggested that I should be using a QRPreview component
> bacause that would let me set a zoom % for display.
>
> Trouble is I can't find any examples of how to use this component
> and anything that I have tried just gives me an Access Violation
> error.
>
> If anyone has any suggestions based either on the above code or
> examples of the use of QRPreview for this sort of purpose, I
> would be eternally grateful
>
> TIA
>
> Mark
>
>
>
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz