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

Printing group header in one page, detail records in next.

edited October 2004 in General
Hi,

I have series of nested groups, for some of them, I would like to be able to
print the group header in a whole page, then print all the detail items in
the next page and continue the report.

Is this possible ? How ?

Regards,

Comments

  • edited October 2004
    Hi Craig,

    You might try either placing a Section Style subreport inside the group
    header with the header information inside the subreport. If this does not
    work, you can try using the Band.OutOfSpace property to break a page. See
    the article below for more ways to break a page.

    ---------------------------------------------
    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
  • edited October 2004

    Nico :

    The trick with the section subreport seemed to work great, except that it
    added a blank page before the header.
    Is this an expected behavior ?

    Also, respecting blank page I have to add, my report looks like :

    MainReport (this contains a subreport)
    ->SubRep1 (the subreport in main report contains all these)
    ->SubRep2
    ->SubRep3
    ->SubRep7

    Subreports are Section style.

    In this layout I always get two blank pages before the report started, is
    this "normal" ?

    Regards,



  • edited October 2004
    >except that it added a blank page before the header.

    I was afraid of that :). Yes, this is the normal behavior. Section style
    subreports work best if they are placed in the detail band. You might try
    keeping the group header objects inside the group header band, then placing
    a section style subreport inside the detail band holding all the detail
    information. If this does not give you the correct results, you may have to
    look at some of the other options for forcing a page break.

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited October 2004

    Nico :

    I reposted the question on a new thread, sorry about that, I was so messy
    that I didn't realize basically I asked the same thing again.

    If I simply drag the lower band delimiter, the one that says "^Group
    Header[0] : MyGroup", just to make it big enough to cover a letter and/or A4
    page ... guess what ? That does the job.
    Now, since it look so simple, I'm afraid it could lead to some weird
    behavior that I'm not preventing now. Any comments on this ?

    Regards,




  • edited October 2004
    Hi Craig,

    This was actually the initial way I got this type of report working. I
    later decided that it looked a little too messy in the designer to recommend
    this route. This method should work for your needs if you can stand having
    a band sized that big in your design :).

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