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

New Page issue

edited May 2005 in General
Hi,

I know this is a popular topic (I've searched through the forums) but I
haven't found a sollution for my problem. I'm using Delphi 5 and RB 6.02.
In the project I'm using a report (with some header information) with a
subreport (several data) in it. What I need to do is to add a pagebreak
right after the subreport is done. I've tried some the suggestions found
here in the forums (RBAddon PageBreak, another subreport with NewPage in the
title) and they all work except the case where the data subreport goes
beyond 1 page. When that happens, the next report item is displayed on that
page (instead of going to a new one). A sollution for this problem would be
much appreciated.

Thanks in advance
Alexandre

Comments

  • edited May 2005
    Hi Alexandre,

    A pagebreak was not a built-in feature in the version of ReportBuilder you
    are using. There are a number of things you can do to simulate a page
    break, however there are always some cases that will break because the RB
    6.02 was not designed to perform this action. ReportBuilder 9.02 comes with
    a new PageBreak component that can be place anywhere on a report causing the
    engine to gracefully break to the next page.

    Although it seems you have tried most of these suggestions, the following
    article is all we have on adding a page break to an older version of
    ReportBuilder.

    ---------------------------------------------
    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;


    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.