I have a ppVariable (a Double) in the detail section. I would like to present the sum for this variable in a group footer. What is the recommended way to accomplish this?
Create a variable in the group footer and update the value of that variable in the OnCalc event of the variable in hte detail section. Something like this...
Thank you. This appears to work when using a detail variable's onCalc event to determine the value of a ppvariable in a group footer.
However, when I try to use the onCalc event of a variable in a group footer to determine the value of a variable in the next higher group footer, I end up with incorrect values. I'm basically summing values in each group footer, progressing to the next higher group.
I set the detail variable's oncalc timing to traversal and reset on traversal. How should I be setting the timing in the first group's variable? GroupStart, GroupEnd, Traversal?
You are going to want to make duplicate calculations for each variable in different groups inside the OnCalc event of the Detail variable. Then you need to set the reset for each of the group variables to GroupEnd. This way, the variables will be receiving the same information but resetting at different times during report generation.
Comments
Create a variable in the group footer and update the value of that variable
in the OnCalc event of the variable in hte detail section. Something like
this...
procedure Variable1Calc(Sender: TObject; Value: Variant);
begin
TotalVariable.Value := TotalVariable.Value + Value;
end;
--
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
to determine the value of a ppvariable in a group footer.
However, when I try to use the onCalc event of a variable in a group footer
to determine the value of a variable in the next higher group footer, I end
up with incorrect values. I'm basically summing values in each group
footer, progressing to the next higher group.
I set the detail variable's oncalc timing to traversal and reset on
traversal. How should I be setting the timing in the first group's
variable? GroupStart, GroupEnd, Traversal?
Thank you again,
Mike Malinowski
You are going to want to make duplicate calculations for each variable in
different groups inside the OnCalc event of the Detail variable. Then you
need to set the reset for each of the group variables to GroupEnd. This
way, the variables will be receiving the same information but resetting at
different times during report generation.
--
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com