>>David, i have the following table, for example:
>>
>>Person Salary
>>------------------
>>Edward 1.4
>>Edward 1.4
>>Michael 1.4
>>Michael 1.4
>>Paul 1.4
>>Paul 1.4
>>
>>I want do show subtotals rounded for each person and
>>display the sum those rounded subtotals in summary band.
>>Report for the data aboe must produce the following result:
>>
>>Person Salary
>>-----------------
>>Edward 3
>>Michael 3
>>Paul 3
>>------------
>>Total 9
>>
>>Can you give me instructions how to to this using report variables?
>
>OK, I'm sending you a "salary.exe" which is a self extracting zip file. Run it from anywhere and extract to a folder of your choice. I've included a .prg which will create an .fxp when it's run. So I've used both report variable and a simple program to solve your problem.
Thank you very much David. I think it is the best hind I have
got from UT this year!
I have modified your function to make it generic since I have
actually a number of subtotals:
function TOTAL
PARAMETER subTot, prmVARIABLE
store eval(m.prmVARIABLE) + m.subTot to (m.prmVARIABLE)
RETURN m.subTot
so in grouop footer I can put a single field
total('sum_salary', round(per_s,0))
The intresting thing is sum_salary report variable:
calculate sum
value to store 0
initial value 0
From where have you learned this way to change report variable in UDF ?
Do you have some other such tricks available?
I is surprise for me that changing the value to store is possible.
I also have some other generic udf's to make tricks in reports.
Those functions will use public variables to store previous
values and so I can dedect group change.
Thank you very much for this wonderful trick. It works in VFP also.
Andrus