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

Force a new page.

edited June 2004 in General
Is there a function to force a new page on run time?

I'm working with a report 3 columns and 1 group break. I only want to force
a new page if the next group doesn't fit on the current page. I tried to
work with the funciton 'keep together' but it doesn't work

Thanks

Isabeau

Comments

  • edited June 2004
    Hi Isabeau,

    There are a few ways to cause a page break in ReportBuilder. The article I
    posted below explains a couple of them. You can also try using the
    Band.OutOfSpace property if you can get the timing correct.

    As for KeepTogether not working, this is not a know issue with
    ReportBuilder. Are you setting a group to KeepTogether and it is still
    breaking in the middle of a page? I will need a little more information
    about how you report is designed to help you get this working correctly.

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


    --
    Thanks for supporting ReportBuilder! Please vote for ReportBuilder in the
    Delphi Informant Readers Choice awards!

    http://www.delphizine.com/ballot2004/

    Best Regards,

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