Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Cleanest way to get report total ?
Message
 
À
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:
00895983
Vues:
13
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.
Cheers,
Jamie
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform