Home General

End of Page Group Detection

edited March 2011 in General
In the footer, how can I detect if a group is being carried over to the next
page or not?

Ken



__________ Information from ESET NOD32 Antivirus, version of virus signature database 5927 (20110304) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com

Comments

  • edited March 2011
    Hi Ken,

    The easiest way to find out of a group has broken or not is to use the
    BeforeGroupBreak or AfterGroupBreak events. You can set a variable
    inside one of these events and check it to be sure the group has not broken.


    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited March 2011
    Nico,

    Thanks for the input. I'm trying to create the equivalent of a bank
    statement to very strict guidelines and it's been a tough one!

    I now have everything else covered but am strugging with the last bit. This
    is the layout of the report

    --------------------------------------------------------------------------------
    Title Band (static blurb)
    --------------------------------------------------------------------------------
    Header Band (not on first page) (static blurb)
    --------------------------------------------------------------------------------
    Group Header[0]:Date (empty)
    --------------------------------------------------------------------------------
    Group Header[1]:RowNumber (empty) grouped so that I can keep the detail
    together
    --------------------------------------------------------------------------------
    Detail band with date, narrative, amount in, amount out, balance (running
    total)
    --------------------------------------------------------------------------------
    Group Footer[1]:Date with different underlines in it (hidden if it is the
    end of Group Footer[0]
    --------------------------------------------------------------------------------
    Group Footer[0]:Date with bold underlines in it
    --------------------------------------------------------------------------------
    Footer band (static blurb)
    --------------------------------------------------------------------------------
    Summary Band (static blurb)
    --------------------------------------------------------------------------------

    What i need to accomplish is that if Group Footer[0] is carried over to the
    next page I need to have the interim balance carried forward amount at the
    bottom of the page before the footer and the interim balance brought forward
    amount at the top of the next page before the first detail band.

    I'm totally lost on how to turn on and off visibility to achieve this. Any
    help greatly appreciated.

    Ken



    __________ Information from ESET NOD32 Antivirus, version of virus signature database 5934 (20110307) __________

    The message was checked by ESET NOD32 Antivirus.

    http://www.eset.com
  • edited March 2011
    Hi Ken,

    If I understand correctly (and please tell me if I'm incorrect) is that
    you would like to display the running balance at the bottom of each page
    even if the group spans multiple pages, and also keep a grand total at
    the end of the group?

    The best way to keep a running page total is to use the Footer Band.
    This band prints at the bottom of every page regardless the group. Then
    if you need to display the same value at the top of the next page, you
    can use the Header band. I understand you have static info in these
    bands, however it should be possible to share the space.


    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited March 2011
    Nico,

    I only want the 'interim balance carried forward' to appear if the group is
    incomplete. In this case the 'interim balance brought forward' must also be
    at the top of the next page.

    It cannot go in the footer, as it must appear immediately below the detail
    band.

    Ken

  • edited March 2011
    Hi Ken,

    In this case your best bet would be to manually keep track of which
    group you are currently on. Create a class variable that stores the
    current break value for the group and compare it to the group's break
    value in when a new page starts. If the values are the same, you can
    make the band/components visible to carry forward the total. If not,
    hide them.

    Another option (as I mentioned before) is to use the BeforeGroupBreak
    event to set a boolean flag, then checking that flag when a new page
    starts. Essentially the same as above.


    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited March 2011
    Nico,

    The only thing I can't manage to do is detect if a detail band is the last
    one on a page.

    Ken

  • edited March 2011
    Hi Ken,

    There is no built-in way to detect the last detail band on a page. The
    report engine itself does not know until it runs out of room. Couldn't
    you use the EndPage event to gather any information needed from the page
    to be displayed on the next?


    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited March 2011
    Nico,

    Thanks for your help, I've managed to sort it out.

    Ken

This discussion has been closed.