Home Subreports
New Blog Post: Email: Multi-Service

Weird paging behavior with master/detail report

edited June 2008 in Subreports

I have an Invoice type report with master/detail setup. The report is
layout as follows:

--Group Header[0]: InvoiceNo
----Detail - Section based Subreport
--Group Footer[0]:InvoiceNo

The Subreport layout is as follows:

--Group Header[0]:ItemNo
----Detail - detail record info
--Group Footer[0]:ItemNo

This report is to display a cover invoice page follow by details of the
invoice. (i.e. Coverpage->detail pages->Coverpage->detail
pages->Coverpage->detail pages...)

Unfortunately, I am running into some issues to get this report to work
properly. The following are 3 scenarios I bumped into:

1)If I have only one record for the master pipeline, I am getting a blank
page at the end. However, if I have multiple master records, I am getting
the following:

Coverpage of invoice#1 -> Detail pages of the invoice#1->Cover page of
invoice#1->Coverpage of invoice#2->detail pages of invoice#2-> Cover page of
invoice#2-> Coverpage of invoice#3->Detail pages of Invoice#3->blank page

2) Interestingly enough, if I delete the Group from the master page, I get
the proper sequence but the very last page does not get generated and shows
up blank.
Coverpage of invoice#1 -> Detail pages of the invoice#1->Coverpage of
invoice#2->detail pages of invoice#2->Coverpage of invoice#3->Detail pages
of Invoice#3 (missing last page of detail pages).

3) Additionally, if I changed the SubReport from a Section Report to a Child
Report, the report goes into an infinite loop and does not generate.

So basically, I am at a loss as to what can I do to fix this issue?

Any ideas?

thanks in advance!


  • edited June 2008
    Hi Wayne,

    Which version of ReportBuilder and Delphi are you using?

    Section subreports are primarily used to combine multiple full reports into
    one. By definition they will take their own page to start and end which is
    why you are getting an extra page. For the type of report you want, I would
    recommend using Child reports.

    Take a look at the subreport demos located in the \RBuilder\Demos\1.
    Reports\... directory. There are numerous examples in there that show how
    to create a master detail report similar to the one your are creating using
    child subreports that will help you see what is going on.

    Take a look at the following article on troubleshooting endless pages.

    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.

    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.


    Nico Cizik
    Digital Metaphors

    Best Regards,

    Nico Cizik
    Digital Metaphors
  • edited June 2008
    Hi Nico,

    Thanks for the reply. I am using reportbuilder 10.08 with Delphi 2007. The
    reason I used a section subreport is that detail pages are like a report in
    itself. The first page is like more or less a title page following by a
    detail report. The reason behind the layout is that I am doing batch
    invoice printing. I am attaching a sample output of this report so you can
    see what I am talking about here. I did looked into the various various
    hints of the article you had provided, but was unable to get it to work
    (getting endless page generation) setting the section report to a subreport
    as you had suggested.

    Any other suggestions?


  • edited June 2008
    Hi Wayne,

    If you are getting blank pages, the section subreports are causing them so
    using them is not an option. If you need to break a page before and after a
    subreport prints, you can set the group in the main report to start a new
    page (Group.NewPage property).

    If possible, please construct a simple example that demonstrates the issue
    and send it to support@digital-metaphors.com in .zip format and I'll take a
    look at it for you.


    Nico Cizik
    Digital Metaphors

    Best Regards,

    Nico Cizik
    Digital Metaphors
This discussion has been closed.