Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Infinite loop - blank pages

edited January 2002 in General
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

Comments

  • edited January 2002
    If the printer setup is 'letter' sized on the subreport, when it should be
    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


  • edited March 2002
    I have the exactly described situation. In TppReport.BeforePrint event by
    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

  • edited April 2002
    Try calling Report.Cancel in the Report.OnStartFirstPass event.


    Cheers,

    Jim Bennett
    Digital Metaphors

This discussion has been closed.