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

Detecting last detail on a page

edited May 2014 in RAP
Any tips to detect if a detail is the last one on a page, be that page 1
of 4 or page 4 of 4?

TIA, Paul

Comments

  • edited May 2014

    Here are a couple of rbWiki examples that track the detail print position
    to determine the last detail. They are both Delphi code examples, to adapt
    to RAP you probably need to add a custom pass thru function to get the print
    position.

    http://www.digital-metaphors.com/rbWiki/Delphi_Code/Formatting/How_To...Draw_a_Line_After_Last_Detail

    http://www.digital-metaphors.com/rbWiki/Delphi_Code/Calculations/How_To...Show_a_Total_in_the_Last_Detail


    Best regards,

    -
    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited May 2014
    Thanks Nard, I'm kicking myself because I've read that article before
    and I was only asking this question because that is exactly what I want
    to do! How did I miss it?! :)
  • edited May 2014
    Hello Nard,

    I've finally got around to implementing this in RAP but I have a number
    of comments about it that I would appreciate you reading through.

    1. This seems like an overcomplicated and very elaborate way of
    achieving a quite modest aim. Could there not be an OnLastDetailOnPage
    event made available to RAP? That way all an end user has to do is put a
    line component in the details section, having all the WYSIWTG control
    over its width, thickness etc, and then use the OnLastDetailOnPage event
    to control its visibility?

    2. As I see it, being able to have a line print after the last detail
    record on a page is the ONLY way of closing off a simple box that
    surrounds all your details, if you don't want the closing line in the
    page footer, so this is a very much needed requirement for a lot of the
    reports we have to supply (invoices, quotes etc).

    3. It took me ages to implement the RTTI exposure (couldn't do it
    properly via an exposure of Report.Engine and just had to fake it with
    new properties for Report). Then I realized that the end user had to be
    able to visually control the LEFT and WIDTH properties, so I put a
    hidden dummy line in the detail section to refer to in the drawing code,
    only to realize then that I'd need to write another pass-thru function
    "PixelsToMMThousandths()" to get the correct values to the TDrawLine.

    4. What the end user had to do to implement this is way beyond most of
    our customer's skills. We'll have to supply them with a knowledge-base
    article, and I know they'll come back with, "really!?".

    As ever, hoping not to sound overly critical - love RB and all its
    extensibility :)

    Paul

  • edited May 2014
    On 15/05/2014 11:12, Paul Toms wrote:

    Not a good idea, even if it relies on TwoPass setting, or something similar?
  • edited May 2014
    Hi Tom,

    Thanks for the feedback. I'll add 'Make it easier to draw a line after last
    detail' to the list of requested features.

    One way to implement a fixed size box on each page is to use a page layer to
    draw the box. This is a simple way to implement a fixed size box on each
    page, but the bottom of the box would be fixed, not after the last detail.

    Another option is to implement a group and use the group footer band, but
    that requires the group detail fit on the page (KeepTogether).

    We have had requests to add a feature to enable to the GroupFooter to print
    on every page. Or add a PageSummary type of band. Either of those would
    enable a line to appear after the last detail.

    It always sounds super simple to implement all this stuff, but when you have
    dynamic height objects: Bands, Subreports, nested Subreports, Memos, etc it
    makes it a real challenge, then add in KeepTogether for groups, subreports,
    memos etc. And I'm sure I'm missing some things. Its very complex. One of
    the limitations in RB now is that the page Footer has to be static height,
    that is because if you have a band that has to print on each page, you need
    to know ahead of time how much space it is reserved by the band, or put
    another way, how space is available.


    Best regards,

    -
    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited May 2014
    Thanks for the feedback, Nard. In particular...


    ..both sound ideal! :)
This discussion has been closed.