I'm porting my application from Delphi 7 to Delphi 2007 and have replaced QR
3 with QR 4 (standard)
In my application i have some reports that are created using a Tqrprinter
Have also a custom preview with a print button.
If i print all pages i have no problem but if i want to print a page
selection (from page to page) have an access violation.
I'm using the code above to print from page to page. An access violation
occurs in the PRINT line. Does someone have a working code ?
SrcFileName := TempFileName;
DestFileName := TempFileName;
CopyFileName := TempFileName;
// Save the report to a file so that we can work with it.
// Build a new file with the range of pages that was selected
RangeFromQRP(SrcFileName, DestFileName, printdialog.FromPage,
with TQRPrinter.Create(nil) do
printerindex := printer.printerIndex;
qrprinter.CustomBinCode := pp.Bin;
// If we want more than 1 copy, we just repeat the pages in the
// list. This will make sure that only a single print job is
if printdialog.Copies > 1 then begin
CopyList := TStringList.Create;
for i := 1 to printdialog.copies do
Print; <...................... ACCESS VIOLATION HERE