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

How calculate a conditional total in a group foofer

edited February 2006 in General
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

Comments

  • edited February 2006
    Hi Massimo,

    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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited February 2006
    Excuse me Nico ... I use the v. 6.03

    Thanks.


  • edited February 2006

    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
  • edited February 2006
    Hi Massimo,

    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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.