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

Fixed area with overflow (2)

edited April 2004 in End User
Sometime ago I asked for the best way to build an end-user report with fixed
area subreports.
The solution you gave to me works (PrintBehaviour = pbFixed and
TraverseAllData=True for the overflowing subreports, ReprintOnOverFlow=True
for the remaining controls), but it seems to work only if the report layout
fits in one page.
My report actually needs two pages (the detail band layout is two pages
long). With two pages the report preview generates thousand of white (empty)
pages
I can provide an example built with your tutorial if necessary

Thanks in advance
Filippo

Comments

  • edited April 2004
    Hi Filippo,

    How are you breaking to the next page? In ReportBuilder, if the detail band
    is physically larger than one page you will get the endless page effect.
    You might try adding a Section Style subreport to the Footer or Summary of
    your main report and adding your second page information to that. By
    default the Section Style subreport will start on a new page. For
    information on other options you can take to break a page, please see the
    article below.

    ---------------------------------------------
    Article: Forcing a Page Break
    ---------------------------------------------

    Question:

    How can I force a page break occur based upon
    a condition calculated at run-time.

    Solution:

    Define a Group that starts on a new page when
    it breaks. Then use the Group.OnGetBreakValue
    event to control the timing of the break.

    1. From the Report Designer, select Report | Groups
    to access the Group dialog.

    2. Define a group based upon a static component,
    such as a Label or Variable. Click the
    Start new page checkbox. Close the dialog.

    3. Using the object inspector's drop down list,
    find and select the TppGroup object.

    4. Create an event-handler for the Group's
    OnGetBreakValue event.

    5. Add code to set the break value.


    procedure Form1.Group1OnGetBreakValue(Sender: TObject; var aBreakValue:
    String);
    begin

    if condition then
    aBreakValue := 'Some Value';

    end;


    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited April 2004
    > How are you breaking to the next page?

    I used a detail band with DynamicHeight.
    Actually the detail band is two physical pages height.
    This seems not cause and endless pages effect, unless we enable the
    ReprintOnOverflow (and so on..)
    Anyway I tried your suggestion:
    1. I putted a section subreport in the footer band
    2. put all the second page's controls in the subreport
    But the second page data never gets printed
    I then tried to put the subreport as the first control in the footer and
    then, below it, the other controls but this cause the endless printing
  • edited April 2004
    Hi Filippo,

    Sorry, my mistake. You cannot place a dynamically sized object inside the
    page footer. Try placing the subreport in the summary band and see if you
    get different results.

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited April 2004
    Now it's all OK!!!!
    Thank you very much.

This discussion has been closed.