crystal reports - Whileprintingrecords Not Working -
i have report doing running total manually ie:
shared numbervar amount:={#amount}; shared numbervar totalamount:=amount+totalamount; amount;
i have separate formula attempting calculate average dividing amount total amount:
whileprintingrecords; shared numbervar totalamount; if {@amount}<>0 {@amount}/totalamount;
despite using whileprintingrecords, total amount not displaying actual total, it's displaying total @ time amount printed. doing wrong?
edit: both formulas in footer of group. test removed groups, , had them both in details section, no groups present. removed running total try , take out of mix, no change.
i'm trying calculate percentage each amount contributes total amount. report like
amount | % $100 | 50% $50 | 25% $50 | 25% ____ $200
instead report ends looking like:
amount | % $100 | 100% $50 | 33% $50 | 25% ____ $200
there can lot of issues why calculation not carried next formula
- placement of 2nd formula may wrong compared first formula placement in report.
- along
whileprintningrecords
try usingevaluateafter
.
whileprintingrecords; evaluateafter(@formula1); shared numbervar totalamount; if {@amount}<>0 {@amount}/totalamount;
edit--------------------------------------------------------------------------------------------- problem here @ each level taking total amount not final value. @ first record value 100
, @amount 100
..now 100/100 100% @ second record value 50
, @amount 150
% 50/150 33.33
. best option use sub report , pass final value 200
input value sub report , display data in sub report.
Comments
Post a Comment