Home Subreports

Section style subreports: Infinite printing

edited December 2003 in Subreports
I have looked at all of the old news postings about section subreports,
but find no remedy for this:

Environment: Delphi 6, RBEnt 7.02, DADE (end-user environment for
creating/running reports)

I am trying to print a two-page report, each page being a subreport. The
main report itself has no data or controls. I have three pipelines, and
two section-style subreports in the detail band of the main report. Each
subreport.data is set to a dataview. The main report.data is set to a
dataview whose only purpose is to have SOMETHING to "be" its pipeline,
even though the main report, as such, has no data or controls. This
seems to be set up as described in several postings on this news group.
(e.g. Nard: "If the subreports each need to start on a separate page,
then create a main report with no header or footer bands and place the
subreports in the detail band. Then set subreport.PrintBehavior to
pbSection for each subreports." )

The problem is that, regardless of whether I set the Report.Data for
each of the subreports to nil or to a dataview, subreport 1 prints as
page 1, and then subreport 2 generates infinite pages.

The result is the same (page 1 is OK, then page 2 prints forever), if
main.data is nil.

The result is the same whether each of the subreports' dataviews is fed
an autosearch value, or whether the autosearch is dropped and the
dataviews are instead linked to the main dataview on the autosearch field.

How can I make it print page two (subreport 2) just once?

dm

Comments

  • edited December 2003
    Surprise (predictable??) solution to the infinite-printing problem:

    By putting the controls in the detail band of the subreports instead of
    in the header (although each subreport returns only a single record), I
    get correct printing behavior (i.e., one page per subreport).

    dm

  • edited December 2003

    1. You can have a main report that is not connected to any datapipeline.
    When report/childreport is nil and AutoStop is set to True, the report will
    print a single detail band and stop. If AutoStop is False, you must call
    Report.Stop in an event-handler to stop the report from producing pages. RB
    automatically toggles AutoStop to True/False when Report.DataPipeline is
    assigned.

    2. If the report bands are set to PrintHeight of phStatic, some report
    configurations can produce an infinite page condition in which the report
    engine cannot fit the band on a page. For example, if the DetailBand plus
    Header/Footer and Top/Bottom Margins exceeds the physical height of the
    page. Solution is to shrink the band heights or set DetailBand.PrintHeight
    to phDynamic so that the detail band can break across multiple pages.

    You may be encountering something else, but the above conditions are common.



    --
    Nard Moseley
    Digital Metaphors
    http://www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
This discussion has been closed.