Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Cleanest way to get report total ?
Message
 
To
16/04/2004 15:32:52
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00895419
Message ID:
00895983
Views:
12
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform