Home General

How do I manually force a Page Break

edited February 2012 in General
I use Delphi 2010 & ReportBuilder 11.... and I am trying to force a page
break on my report, and having trouble doing so. I cannot use the
GroupBand.NewPage property as I don't want to page break every time the
Group Band changes... only sometimes.

My report is a Menu Calendar type of report with dates & meals... I created
a Meals Group Band, and every time a meal changes, it calls the Meal Group
Band... and in the beforePrint event for the Meals Group HeaderBand, I check
the SQL to see what meal I'm on... and if its the meal I want....then I want
to say 'Page Break NOW'.... and if its not the meal I want, then I don't
want to page break.

I've searched around... and I found an old email that Nico wrote that
suggests using the component TppPageBreak. There were no details on how to
use TppPageBreak [other than just saying to place it on the form], and I
cannot find any detailed help on it... or more importantly, a sample of code
for it. I cannot put the TppPageBreak component directly on my form... I
need to create it manually, and then call it at RunTime.

So, how do I manually create this TppPageBreak component in the code, and
then initiate a call to it during the Meal Group Band, only when I need to?

Denise Mace
Applications Developer
Computrition, Inc.
dmace@computrition.com

Comments

  • edited February 2012
    Hi Denise,

    Creating a TppPageBreak component is similar to creating any other
    report component in code. You simply create the component and assign
    it's Band property and location.

    I do not believe you will need to use this. I would suggest checking the
    field value of the group before it prints (OnGetBreakValue perhaps) and
    try toggling the NewPage property of the group based on that value.

    Best Regards,

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