Infinite loop - blank pages
Lots of postings about RB going into a loop, but no solutions that help us.
Can anyone give me some suggestions how to fix an endless loop in this case:
simple master-detail, report to be printed for one master, looping over all
its detail (always at least one, alwasy filled) in one SubReport, only some
ppLabels and ppDBTexts, all pipelines hooked up.
All goes well in preview, and also in the subsequent print, UNLESS a user is
in Europe and uses A4 page format rather than the Letter used at design
time. Then the preview is still ok, but the print produces thousands of
pages.
The only thing that I can think of is the SubReport having
ParentPrinterSetup at True. In the BeforePrint even of the whole report, we
pick up the settings of the current default printer, like this:
-------------
lPrinter := TppPrinter.Create;
lPrinter.PrinterName := ppPrinters.DefaultPrinterName;
// assign default printer settings to a report
ppReport1.PrinterSetup := lPrinter.PrinterSetup;
lPrinter.Free;
-------------
Could it be that the Subreport is still at the 'Letter' page size set at
design time? Could this give problems?
And what is the point of setting ParentPrinterSetup at False for a
SubReport? I cannot find where to set its own PrinterSetup, if it has one.
Thanks, Roy Jonker
Can anyone give me some suggestions how to fix an endless loop in this case:
simple master-detail, report to be printed for one master, looping over all
its detail (always at least one, alwasy filled) in one SubReport, only some
ppLabels and ppDBTexts, all pipelines hooked up.
All goes well in preview, and also in the subsequent print, UNLESS a user is
in Europe and uses A4 page format rather than the Letter used at design
time. Then the preview is still ok, but the print produces thousands of
pages.
The only thing that I can think of is the SubReport having
ParentPrinterSetup at True. In the BeforePrint even of the whole report, we
pick up the settings of the current default printer, like this:
-------------
lPrinter := TppPrinter.Create;
lPrinter.PrinterName := ppPrinters.DefaultPrinterName;
// assign default printer settings to a report
ppReport1.PrinterSetup := lPrinter.PrinterSetup;
lPrinter.Free;
-------------
Could it be that the Subreport is still at the 'Letter' page size set at
design time? Could this give problems?
And what is the point of setting ParentPrinterSetup at False for a
SubReport? I cannot find where to set its own PrinterSetup, if it has one.
Thanks, Roy Jonker
This discussion has been closed.
Comments
A4, then that may be the cause of the inifte loop. If ParentPrinterSetup is
false and incorrect at runtime, then configure the printer setup of a
subreport by accessing the Subreport.Report.Printersetup object.
Sometimes, it can be useful to change the printer setup in order to print
one subreport as portrait and the next one in landscape.
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com
testing the size of the paper
I'm trying to stop the print process (tppReport.Reset, cancel=true,...
doesn't work,probably because
CancelDialog is a modal wnd).So my question is:
"How can I stop the printing process if CancelDialog is already shown?"
Thanks,
Dan E.Mincu
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com