Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Cleanest way to get report total ?
Message
De
19/04/2004 21:02:47
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Divers
Thread ID:
00895419
Message ID:
00896321
Vues:
28
Believe me, this one bothered me occasionally for a couple of years... in the nineties. Once I solved it, it was "how could I not see such a simple thing", and "is there a softer wall around here, to bang my head against?".

>Ahah ! Thanks. I knew there must be a nicer way than a UDF().
>
>
>>>The grand total is my problem (well it's not - I just have to use a kludge to get it). If I simply sum the total field I will get 340 as the total - not 170 - as it will sum every detail record. Since the data is denormalised each detail record actually has the group total in it.
>>>
>>>Now do you see my question :)
>>
>>Ah, that one.
>>
>>Have two report variables, one cGroupExpr, and nTotal. CGroupExpr="" initially, nTotal=0. For each record, nTotal=ntotal+iif(cGroupExpr=YourGroupExpr, 0, AmountInTheRecord), cGroupExpr=YourGroupExpr. Just make sure the nTotal is created before the cGroupExpr, so it will be assigned before the cGroupExpr. This way, cGroupExpr will be different from the group expression once for each group.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform