Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
It is not possible to sum rounded subtotals!!
Message
From
24/12/1998 10:40:57
 
 
To
22/12/1998 17:54:26
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00169097
Message ID:
00170270
Views:
33
>>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform