QuickReport |
Top Previous Next |
a) using the filer component
For QuickReport support please compile the unit wppdfQR.pas into your wPDF (or WPTools) package. Now you can place the component TQRwPDFFilter on the form.
b) using code
It is also possible use Your own code to create the PDF output:
var aMeta: TMetaFile; PageNum: Integer; begin WPPDFPrinter1.FileName := 'C:\DEMO.PDF'; FCount := 0; try Quickreport1.Visible := FALSE; WPPDFPrinter1.CanvasReference := wprefScreen; WPPDFPrinter1.BeginDoc; Quickreport1.Prepare; for PageNum := 1 to Quickreport1.QRPrinter.PageCount do begin WPPDFPrinter1.StartPage(Quickreport1.QRPrinter.PaperWidthValue, Quickreport1.QRPrinter.PaperLengthValue,254,254, 0); aMeta := Quickreport1.QRPrinter.GetPage(PageNum); try WPPDFPrinter1.DrawMetafileEx(0,0,0,0,aMeta.Handle, Screen.PixelsPerInch, Screen.PixelsPerInch ); finally aMeta.Free; WPPDFPrinter1.EndPage; end; end; WPPDFPrinter1.EndDoc; Quickreport1.QRPrinter.Free; Quickreport1.QRPrinter := nil; finally Quickreport1.Visible := TRUE; end; end;
|