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

Print To Screen and Then Print To Printer causing infinite loop

edited April 2002 in General
I am using Delphi 6.
Report Builder Version 6.

The problem that I am having is kind of odd. I have a report that when I
print it to the screen to preview it, will print just fine and show exactly
what it should. Also if I just print directly to the printer and do not
preview it, it will print just fine. The problem is when I print the report
to the screen, and then from the print preview screen send that to the
printer it will reprint the report but will just keep printing pages in an
infinite loop. I have to end up doing a Ctrl+ Alt+ Delete to stop it. I
have tried putting the CachePages set to true and to false however either
way it does the same thing. It is only when I send the report to the
printer from the print preview screen that this happens. I am on site at a
customers location right now so I would really appreciate some help with
this one as soon as someone can help me.

Thanks in advance...

--

Brian Tackett
SofTek Software International, Inc.
btackett@softeksoftware.com

R&D: 330-743-1229

Comments

  • edited April 2002
    Please try these basic guidelines to see if they might help you track down
    the problem. If you are using any of your own positioning variables in any
    event handlers, make sure you reinitialize those in the report's BeforePrint
    event. The event handlers will fire again once the report is printed. If the
    problem persists, please send a sample project that reproduces the error to
    support@digital-metaphors.com.

    ------------------------------------------------------
    Article: TroubleShooting: Report Prints Endless Pages
    ------------------------------------------------------

    Occasionally, we have customers state that their reports are in some
    infinite state where page after empty page prints forever.

    There are a few items to check when this occurs.

    The TppReport.AutoStop property is the first thing to check. If this is
    false when the DataPipeline property is unassigned, the endless report will
    be the result. AutoStop is automatically set to True when DataPipeline is
    set to nil, but it is possible to set it back to False. Check for instances
    in your code where you might have created this condition.

    Another thing to check is that all subreports in your report have their
    DataPipeline set. When a subreport does not have its pipeline set, you will
    sometimes see a condition where the first detail record prints and then you
    get blank pages.

    Another, non-data related cause can sometimes be your margin settings. If
    you have stretching bands that need to overflow to the next page, if your
    margins are too tight, sometimes the report engine will endlessly overflow
    to the next page trying to fit the overflow material. As a test, try setting
    DetailBand.PrintHeight to phDynamic. A dynamic height band can overflow to
    additional pages as needed.

    Still another cause might be having a statically positioned control, set to
    ReprintOnOverFlow, in the same band with a stretching control. For instance,
    if you have a memo set to stretch and in that same band, a label control set
    to ReprintOnOverFlow, then on every page after the first, the memo will
    begin to print after the label control. If the label is placed low enough
    that the memo has no room to print, the report will forever be trying to
    print the overflowing memo on the next page.

    --
    Cheers,

    Alexander Kramnik
    Digital Metaphors

This discussion has been closed.