Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Manipulating non-detail variables in a report
Message
De
21/07/1999 13:20:29
 
 
À
16/07/1999 08:41:55
David Abraham
David Abraham & Associates, Inc.
New York City, New York, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Divers
Thread ID:
00242254
Message ID:
00244244
Vues:
27
>I created a Sales Commission Report using VFP's Report Designer.
>
>It has 5 breaks (bands), major to minor: salesman, date, order#, shipment#, detail line.
>
>I feed the report a single cursor (not a requirement, just seems to be the way to do it) which has loads of data at the detail level and some data (including numeric values) at the group (shipment#, order#) level.
>
>Some of the expressions I print in report footers are not sums of detail amounts but rather amounts that belong to break level data. F'r instance, the cursor has a column that is a shipment amount and I display that for the first time in the shipment# footer band.
>
>It is easy enough to display this at the Shipment# level, but when I go to SUM it for the next level, the Order# level, it is all screwed up, as it seems to add it up once for every detail line, not once per shipment, even though it is a figure that does not belong to the detail level.
>
>If I have been clear, what do I do to correctly calculate and display a SUM of non-detail numbers?

1. Add a variable named r_Sum to report/variables:
Initital value 0
Value to store 0
Calculate Sum
Reset at End of report

2. In group footer, add a field and use
total( , 'r_sum' )


func TOTAL
PARAMETER subTot, prmVARIABLE
store eval(m.prmVARIABLE) + m.subTot to (m.prmVARIABLE)
RETURN ''
Andrus
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform