Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Cleanest way to get report total ?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Divers
Thread ID:
00895419
Message ID:
00895444
Vues:
23
The only other option I can think of is to go through the cursor after you create it, and zero out the totals on all but the last record for the group.

>Yeah - that's what I'm doing. I thought maybe there was some obvious way to do it totally within the report that I had missed all these years.
>
>
>>Sorry, I wasn't thinking. I would define a report variable, and in the OnExit of the group footer, call a UDF that adds the Total for the current record.
>>
>>>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 :)
>>>
>>>>For the subtotal, just copy the Total field into the group footer. In this case, you don't need any calculation, because each record is already showing the total for the group.
>>>>
>>>>For the grand total, create a summary band (via the Report | Title/Summary option) and copy the Total field there. Go into the calculations and select "sum", and reset at end of report.
>>>>
>>>>>If I have a denormalised cursor such as :
>>>>>
>>>>>GRpId Detail Total
>>>>>1 "Foo" 100
>>>>>1 "Bar" 100
>>>>>2 "blah" 70
>>>>>2 "wah" 70
>>>>>
>>>>>and want a report to output as follows :
>>>>>
>>>>>Detail Total
>>>>>Foo
>>>>>Bar
>>>>> Total: 100
>>>>>blah
>>>>>wah
>>>>> Total: 70
>>>>>------------------
>>>>> Total: 170
>>>>>
>>>>>What is the nicest way inside the report to get the report total ? Is using on an on exit expression in the group band the only way ?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform