Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Cleanest way to get report total ?
Message
De
16/04/2004 15:32:52
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:
00895688
Vues:
22
This message has been marked as the solution to the initial question of the thread.
>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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform