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

Page breaking

edited June 2003 in General
Is it possible to force RB to start a new page if there is not enough room
left on the page to print all stretchable fields of a record, i.e. the
equivalent of a Group's keep together property.

My report template comprises of TppDBMemo fields seperated by vertical
lines, all of which stretch with parent. If a page break occurs in the
middle of a memo, the rest is printed on the next page but without the
lines.

Comments

  • edited June 2003
    James Kirby

    <

    Check out the grouping option. I believe you can specify "keep group together" If the memo cannot be printed entirely on the page it will eject to the next.

    HTH,

    --
    C Clemans

    Ledger Accounting Software
    www.ledgeraccounting.com
    Posted with XanaNews Version: 1.15.2.6
  • edited June 2003
    ---------------------------------------------
    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.

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited June 2003
    Thanks for the info but it does seem a bit of a fiddle for what is a simple
    objective. Can I suggest the inclusion of a "Keep Together" or "Start New
    Page If Row Doesn't Fit" property for the DetailBand in a future release.

    Cheers,

    James

  • edited June 2003
    James,

    Try placing everything in the Detailband inside a Region. Then you can set
    the Region.KeepTogether property to true so the detail fields will stay
    together if the page breaks.

    --
    Best Regards,

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