Board index » delphi » Saving QuickReport (*.qrp) files

Saving QuickReport (*.qrp) files

I am trying to save a copy of each quickreport generated by my program in
*.qrp format using code. The helpfile in my copy of Delphi 4 led me to
example code similar to this:

begin
Report1.QuickRep1.Prepare;
   try
      Report1.QuickRep1.QRPrinter.SaveToFile('MyReport.qrp');
   finally
      Report1.QuickRep1.QRPrinter.Free;
   end;
   Report1.QuickRep1.QRPrinter := nil;
end;

but I get an error "undeclared identifier: SaveToFile".
I have tried all sorts of fiddling with the code but can't get it to work.

Can anyone help please?

Thanks.

 

Re:Saving QuickReport (*.qrp) files


Hi xtu,

I had a similar problem a while back, and this is how i fixed it

StatusBar.SimpleText := 'Generating...';

// these lines seem to be necessary
RepForm.CustQuickRep.Prepare;
// you don't have to compress it, but it can make up to 75% space saving
difference
RepForm.CustQuickRep.QRPrinter.Compression := True;
// getwindir is one of my own subs for getting the windows directory
if not DirectoryExists(GetWinDir+'Desktop\Saved Reports\') then
ForceDirectories(GetWinDir+'Desktop\Saved Reports\');
RepForm.CustQuickRep.QRPrinter.Save(GetWinDir+'Desktop\Saved
Reports\Customer List ('+AgentName+').qrp');
RepForm.CustQuickRep.QRPrinter.Free;
RepForm.CustQuickRep.QRPrinter := nil;
// up to here, it seems to want to be set back to nil before you preview
it after saving, nfi why... :)
RepForm.CustQuickRep.PreviewModal;
StatusBar.SimpleText := '';
CustQuery.Close;

HTH,

John.

Quote
xtu10 wrote:

> I am trying to save a copy of each quickreport generated by my program in
> *.qrp format using code. The helpfile in my copy of Delphi 4 led me to
> example code similar to this:

> begin
> Report1.QuickRep1.Prepare;
>    try
>       Report1.QuickRep1.QRPrinter.SaveToFile('MyReport.qrp');
>    finally
>       Report1.QuickRep1.QRPrinter.Free;
>    end;
>    Report1.QuickRep1.QRPrinter := nil;
> end;

> but I get an error "undeclared identifier: SaveToFile".
> I have tried all sorts of fiddling with the code but can't get it to work.

> Can anyone help please?

> Thanks.

Re:Saving QuickReport (*.qrp) files


Quote
"John" <j...@psion.ihatespam.co.za> wrote in message

news:3B4570BB.B847B25C@psion.ihatespam.co.za...

Quote
> Hi xtu,

> I had a similar problem a while back, and this is how i fixed it
> StatusBar.SimpleText := 'Generating...';

<snip>

Thanks John. Very helpful reply. Problem solved.

Other Threads