How calculate a conditional total in a group foofer
Hi all,
i must calculate some totals in the group footer based on some conditions.
To do this, I use the tppvariable component in the footer band and in the
oncalc
event i have coded this condition
if Table['CODE'] = 'TEST' then
value := value + Testata['VALUE'];
The total that is calculated, sum twice the last record of the group and
therefore is incorrect.
Can i do the same with a tdbCalc component ?
Thanks in advance for the answers.
Massimo
i must calculate some totals in the group footer based on some conditions.
To do this, I use the tppvariable component in the footer band and in the
oncalc
event i have coded this condition
if Table['CODE'] = 'TEST' then
value := value + Testata['VALUE'];
The total that is calculated, sum twice the last record of the group and
therefore is incorrect.
Can i do the same with a tdbCalc component ?
Thanks in advance for the answers.
Massimo
This discussion has been closed.
Comments
Which version of ReportBuilder are you using? In versions prior to RB 9,
there was a limitation with placing TppVariable or DBCalc components inside
the footer band with a dynamic detail band. This has been enhanced for RB 9
and later however there still are some cases that do cause problems.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Thanks.
Hi Nico,
perhaps i have found a solution ....
I use a dbCalcComponent where i havn't assigned the datafield property; this
component
is in the group footer band.
In the oncalc event of this component i have coded :
if Table['CODE'] = 'TEST' then
value := value + Testata['VALUE'];
With this trick all seems work fine.
Do you think that this solution may be correct ?
Thanks in advance.
Massimo
message
9,
RB
and
Yes, keeping all your calculations in the group footer will solve the
problem immediately. Glad you were able to find a work-around.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com