Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
It is not possible to sum rounded subtotals!!
Message
De
24/12/1998 18:33:58
 
 
À
24/12/1998 10:40:57
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Divers
Thread ID:
00169097
Message ID:
00170401
Vues:
37
>>>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.

My pleasure. I'm real glad it worked fine.
I'm really indebted to Lisa Slater (who is in New Zealand these days) for teaching me about the report writer. She wrote an excellent booklet some years ago called "The Foxpro 2 Report Writer". It was available from Pinnacle publishing. And might still be around. Lisa's a programming genius.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform