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

How to calculate value os two Groups?

edited June 2005 in General
Hello, I have one report, and I have two Group: Group[0] codint and
Group[1]: tipo_desc.. in the footer os Group[1] I have one DBCalc, to
calculate the sum of field Valor and I have one DBText1 to show me value of
field TIPO (integer), my question is...


Sorry my english, next the example:

+------------------------------
| Detail
| TIPO=1 DBCalc1.Value = 130
| TIPO=1 DBCalc1.Value = 50
| TIPO=2 DBCalc1.Value = 30
|-----------------------------------
| Footer GRoup[1] DBCalc1 = 130+50-30 = 150
|-------------------------------
| Footer GRoup[0] SystemVariable = (Sum of DBCalc1)
|-------------------------------

How I do this? I hop to explain correct :-)

Thanks for all..

Fellipe H.

Comments

  • edited June 2005
    Hi Fillipe,

    Instead of using DBCalcs in the group footers, try using TppVaribles
    instead. For instance...

    +------------------------------
    | Detail
    | TIPO=1 DBText1.Value = 130 Variable1
    | TIPO=1 DBText1.Value = 50 Variable1
    | TIPO=2 DBText1.Value = -30 Varialbe1
    |-----------------------------------
    | Footer GRoup[1] Variable2 (reset on StartGroup1)
    |-------------------------------
    | Footer GRoup[0] Varialbe3 (reset on StartGroup2)
    |-------------------------------

    Inside the Variable1.OnCalc event update the value of Variable2 and 3.

    Variable2.Value := Variable2.Value + Report.Datapipeline['myfield'];
    Variable3.Value := Variable3.Value + Report.Datapipeline['myfield'];

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited June 2005
    I try to do this.... but don't work.... do you can send me example?


    thanks

    Fellipe H.
  • edited June 2005
    Hi Fillipe,

    Which version of ReportBuilder are you using? Take a look at the following
    example. It shows what I was talking about in my first post.

    http://www.digital-metaphors.com/tips/DetailSummaryInMain.zip

    --
    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.