Mega Code Archive

 
Categories / Delphi / Examples
 

Print a selection on the non-default printer with quickreport

Several people have experienced problems with printing a QuickReport to a non-default printer. Another issue is printing of selected pages. QuSoft saw this and added a function PrinterSetup() which works properly with their model (other than my own TPrintDialog instances). The following code shows how to print the current page or selected pages. // ... theReport : TQuickRep; ReportPreview: TQRPreview; // ... begin // print one page.. with theReport do begin PrinterSettings.FirstPage := theReport.PageNumber; PrinterSettings.LastPage := theReport.PageNumber; ReportPreview.QRPRinter.Print; end; end;