Sum fields in label before group break
Hallo all,
I have to print report who have fields to sum before break.
I have add a variable to sum the fields and it works. I have insert showmessage in OnCalc (Value := Value + DBTable['my_table_name'];) to control, and the number is increased.
Then I have used in Groups[0], the AfterGroupBreak to clear the Variable1.Value ( := 0) and, when the break occour, it is cleared.
But I'm not able to find the right procedure to set the label (Text or Caption) the number set in Variable1.Value before the break.
I have tryed to write it when I add the Field value to Variable1.Value in OnCalc, but only the first time is stored, and when I try to show it, I see only the value set in first field.
Can anybody help me?
Thanks in advance,
Sergio
I have to print report who have fields to sum before break.
I have add a variable to sum the fields and it works. I have insert showmessage in OnCalc (Value := Value + DBTable['my_table_name'];) to control, and the number is increased.
Then I have used in Groups[0], the AfterGroupBreak to clear the Variable1.Value ( := 0) and, when the break occour, it is cleared.
But I'm not able to find the right procedure to set the label (Text or Caption) the number set in Variable1.Value before the break.
I have tryed to write it when I add the Field value to Variable1.Value in OnCalc, but only the first time is stored, and when I try to show it, I see only the value set in first field.
Can anybody help me?
Thanks in advance,
Sergio
Comments
Do not use the AfterGroupBreak to reset a value, use the ResetType or ResetGroup properties (Variable/DBcalc).
I suggest spending some time with our tutorials and demos to get a better understanding how calculations are handled in ReportBuilder. Demos 14 - 19 show how to use DBCalcs and Variables in conjunction with groups to keep running totals etc.
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
I have use the DBCalc for fields sum, but at the end I'not undestand how get value of sum by DBCalc!!
I whant to execute the filling of the label, immediately BEFORE the AfterGroupBreak, when the DBCalc have make the sum of the last field of group.
Did you look at the demos I mentioned? These demos show exactly how to use DBCalc and Variable components in this way.
Also, please work through the "Groups, Calculations, and the Summary Band" tutorial to get a better idea how to make calculations work in your reports.
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com