Summarizing TppVariables in footers
Hello,
I have variables in the detail band which perform a calc using other fields
in the band. Then, I'd like to do SUM on the variable results in the group
and report footers to get running totals of the variable value (i.e a
commission report whereby I'm calculating the commission and stuffing the
result in the TppVariable)..
I first put everything in the BeforeGenerate...all is well except that on
the bottom of a page the BeforeGenerate fires, sees it can't print, so fires
again on the top of the next page and causes my totals to add that detail
band twice.
I can probably use the OnCalc and store my running totals somewhere else,
but knowing when is the one time to add the current detail band result to
the running totals I'm not sure on. First, is there any easy way to have RB
do the totaling of TppVariables automatically, like it does with DBCalc?
Second, what event should I use as the point at which I would update my own
running totals with the detail band's variable results, such that I could
use the OnCalc event in the footers (or the BeforeGenerate) to fill in those
values?
Thanks,
Mike Van Nuland
I have variables in the detail band which perform a calc using other fields
in the band. Then, I'd like to do SUM on the variable results in the group
and report footers to get running totals of the variable value (i.e a
commission report whereby I'm calculating the commission and stuffing the
result in the TppVariable)..
I first put everything in the BeforeGenerate...all is well except that on
the bottom of a page the BeforeGenerate fires, sees it can't print, so fires
again on the top of the next page and causes my totals to add that detail
band twice.
I can probably use the OnCalc and store my running totals somewhere else,
but knowing when is the one time to add the current detail band result to
the running totals I'm not sure on. First, is there any easy way to have RB
do the totaling of TppVariables automatically, like it does with DBCalc?
Second, what event should I use as the point at which I would update my own
running totals with the detail band's variable results, such that I could
use the OnCalc event in the footers (or the BeforeGenerate) to fill in those
values?
Thanks,
Mike Van Nuland
This discussion has been closed.
Comments
TppVariables do not have any built-in functionality. You should always use
the OnCalc event when making calculations with a TppVariable. The one
exception is when you are calculating a subtotal for each page inside the
footer band with a dynamic height detail band. In this special case, you
will need to use the DetailBand.BeforeGenerate event. Please see the
example below.
http://www.digital-metaphors.com/tips/PageSubTotal.zip
--
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com