How to calculate a total of a total
On each detail line I have a calculation (using a TppVariable) to calculate
ColA - ColB - ColC. Call this variable Var1.
In the summary band for the report I want to calculate Sum (ColA) - Sum
(ColB) - Sum (ColC), equals Sum (Var1).
I already am using TppDBCalcs for Sum (ColA), Sum (ColB) and Sum (ColC). I
can't figure out how to get Sum (Var1), though. Any help is much
appreciated.
ColA - ColB - ColC. Call this variable Var1.
In the summary band for the report I want to calculate Sum (ColA) - Sum
(ColB) - Sum (ColC), equals Sum (Var1).
I already am using TppDBCalcs for Sum (ColA), Sum (ColB) and Sum (ColC). I
can't figure out how to get Sum (Var1), though. Any help is much
appreciated.
This discussion has been closed.
Comments
Value := {your formula here};
TotalVar.Value := Value;
end;
With this approach, TotalVar will not have any event handlers assigned...
--
Cheers,
Tom Ollar
Digital Metaphors Corporation
http://www.digital-metaphors.com
info@digital-metaphors.com
TotalVar.Value := TotalVar.Value + Value;
with an initialization of TotalVar.value := 0 before the report starts.
This would work if each row in my dataset were traversed only once. It
seems, though, that when I page up and down through the report, the
var1.onCalc events fires multiple times for the same row, and my
totalVar.value isn't calculated correctly.
Maybe I need to change a property? Is there another suggestion?
The 'OnCalc' should be fired only once per row. Do you manipulating the data
during traversion? Try setting 'cache pages' to true.
regards,
Chris Ueberall;
Var1 onCalc event (which occurs for each for in the report) I'm using the
calc event of my summary DBCalc objects. Thanks for the help.