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

Subtotals

edited July 2010 in RAP
I'm trying to accumulate Double values as they print in a detail line to
later print subtotals in a group footer. Unfortunately, placing the
code to accumulate these totals in events like BeforePrint and
AfterPrint seems to be giving me unpredictable results.

Taking the simple case, I have a global variable X and each time a
detail line is printed, I want to add the content of a database value
(for example, Trx['UCount']) to it, then print the subtotal in the group
footer, zero the global variable X, and start the process over.

So, I'm trying to determine which events are the correct places to (a)
accumulate the total, and (b) zero it after printing. Also, any
additional traps I may need to look out for (I noticed remarks on
setting static band height, which I tried but didn't make any difference).

To me, the obvious places are the BeforePrint and AfterPrint handlers
for the detail band, but that yields strange results as one pages
through the report. This is on an older version (6.x), and I don't work
with this particular product routinely, so I'm struggling. Any guidance
is appreciated.

DR.

Comments

This discussion has been closed.