Tppvariable
Hello
i have 3 sums in a group footer where i want those 3 values as total in a
Tppvariable . So i wrote a oncalc handler and summed these 3 values.
The first time i see the report the value is not correct, but after showing
it the second time the value is correct.
What i'm a doing wrong
The report passseting is twopass.
Regards Frank
i have 3 sums in a group footer where i want those 3 values as total in a
Tppvariable . So i wrote a oncalc handler and summed these 3 values.
The first time i see the report the value is not correct, but after showing
it the second time the value is correct.
What i'm a doing wrong
The report passseting is twopass.
Regards Frank
This discussion has been closed.
Comments
Rather than calculate the value of the three sums, try calculating the sum
directly in the OnCalc of the TppVariable. If the timing is set to
Traversal (which is the default setting), the OnCalc event will fire for
each record. Something like the following...
begin
Value := Value + Report.Datapipeline['MyField1'] +
Report.Datapipeline['MyField2'] + ... etc.
end;
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
that seems to work great except that 1 have one field that has to be
subtracted once.
So
Field 2
Field 2
Field 2
totaal 6
Cost -6
sum 0
In your case the cost field is also 3 times in the value so i get a value of
6 -18=-12
how can i do that ?
Frank
In this case, you could possibly keep track of the field that needs to be
subtracted separately from the others using a separate variable or a class
field. Or you could place a condition in the OnCalc to only use the
subtracted field once.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com