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

Running total, page by page

edited August 2007 in RAP

How can I count the total number of detail items shown so far? (Shown in
the footer.)

What happens now is that the count increases every time I swap pages
(forwards or backwards). Or, if I skip to the end of a long report, the
pages in between won't be included in the count.

eg.
(It's the "Total:" part that I can't solve.)
Page1
This page: 5
Total: 5

Page2
This page: 7
Total: 12

Page3
This page: 4
Total: 16

Comments

  • edited August 2007
    Hi Peter,

    1. Be sure you are using a two pass report.

    2. Try placing a DBCalc component inside your footer band set to calculate
    the Count(*). This should give you the number you are after. Otherwise you
    can use a TppVariable and its OnCalc event if you would like more control
    over what is displayed.

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited August 2007

    Thanks, the DBCalc component is good. But I'm still not clear on one
    thing...

    How can I do so each page adds to its total once only? Currently, my totals
    are being increased each time a page is rendered.

    eg.
    In the report below I go to page 3 and see Total: 16. (Pages 1-3) Good.
    Then I flip to page 2 and see Total: 23. (Pages 1-3 + Page 2) Wrong.
    Then I flip to page 3 and see Total: 27. (Pages 1-3 + Page 2 + Page 3)
    Wrong.

    Page1
    This page: 5
    Total: 5 (Page 1)

    Page2
    This page: 7
    Total: 12 (Page 1 + Page 2)

    Page3
    This page: 4
    Total: 16 (Page 1 + Page 2 + Page 3)

    I should add that I'm not incrementing the count for all records. I only
    increment for those records that have a certain value. DBCalc keeps track
    of the row number, and that's useful, but it's not conditional (or have I
    missed something). But if it's a number that is calculated conditionally
    using RAP, then a different system is needed... I guess.
  • edited August 2007
    Hi Peter,

    Try setting the Report.CachePages property to True and see if that solves
    the problem for you.

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited August 2007

    Thanks! That plus setting the PassSetting to psOnePass did it.
This discussion has been closed.