LookAhead
Hello :
I'm creating an end-user report with one group and one summany.
I need to print in the group's footer band the percentage relative to the
total :
Example :
Product 1 , Total 30 kg (DBCalc2) pct. : 30% (variable1)
Product 2 , Total 60 kg.(DBCalc2) pct : 60% (variable1)
Product 3 , Total 10 kg.(DBCalc2) pct : 10% (variable1)
Summary : Total 100 kg (DBCalc3)
What I do :
Report : Two Pass
DBCalc3 : lookAhead := True
variable1.OnCalc :
Value := (100*DBCalc2.Value) / DBCalc3.Value
But it doesn't work
Do you know what should I do?
Thank you
David
I'm creating an end-user report with one group and one summany.
I need to print in the group's footer band the percentage relative to the
total :
Example :
Product 1 , Total 30 kg (DBCalc2) pct. : 30% (variable1)
Product 2 , Total 60 kg.(DBCalc2) pct : 60% (variable1)
Product 3 , Total 10 kg.(DBCalc2) pct : 10% (variable1)
Summary : Total 100 kg (DBCalc3)
What I do :
Report : Two Pass
DBCalc3 : lookAhead := True
variable1.OnCalc :
Value := (100*DBCalc2.Value) / DBCalc3.Value
But it doesn't work
Do you know what should I do?
Thank you
David
This discussion has been closed.
Comments
You should not use DBCalcs to make calculations in this manner because the
DBCalcs are updated by the draw command architecture, not through its value
in RB. The link below leads to a demo
that may help you achieve your goal.
http://www.digital-metaphors.com/tips/PercentageOfGroupTotal.zip
--
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com