Running total, page by page
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
This discussion has been closed.
Comments
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
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
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.
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
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Thanks! That plus setting the PassSetting to psOnePass did it.