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

NewPageThreshold

edited February 2005 in General
Hi Folk?s,

How can i do to control remaning space at page to setup a NEWPAGETHERESHOLD?

My report contain 2 pageheader and i need adjust 2nd break to print at new
page if the user wish.

Thank?s

Gustavo

Comments

  • edited February 2005
    Hi Gustavo,

    Which version of ReportBuilder are you currently using? The latest version
    (9.01) includes a PageBreak component that allows you to cause a pagebreak
    anywhere you like on a report. If you are not using 9.01, take a look at
    the following article on how to force a page break.

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

    Question:

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

    2 of the best solutions follow:

    Solution 1:

    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;


    Solution 2:

    1. Place a subreport at the point where you might want a page break.

    2. Remove its summary band and reduce the height of its detail and
    title bands to zero.

    By programmatically setting the title band's NewPage property you can
    conditionally force a page break. Note that everything after the
    subreport that is in the same band with it will need to
    ShiftRelativeTo the subreport.

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited February 2005
    Nico I really tried this code. Many times, also. I never obtained to make
    to function. I come trying to control the breakings based in the remaining
    space of each page, or either: If the espaco disponivel will be lesser or
    equal to the size of the half of the leaf. ("NewPageThreshold"). 6.02
    version and Delphi 5. How to know how much of space still has in the page?
    In which event this code must be placed?

    Thank You,

    Gustavo

    BTW: Save the "Google translation tools"

This discussion has been closed.