Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to have total for detail and header records
Message
De
21/08/2007 23:33:01
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows Server 2003
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01249062
Message ID:
01249503
Vues:
20
Then whats use of having a alias for detail band the save was achieved in FPD26 also. I thought it would work like in Crystal report.
Rajesh
>>I have a report where the order header and detail have relation. The report is grouped on orderno. The detail band has alias orderdtl. The report at the end has totals for fields from orderdtl and orderhdr table. The totals for table orderdtl are correct but the totals of orderhdr are multiplied by the numer of records in that order.
>>
>>Rajesh
>
>Report variables or expressions you mark as SUM are processed once for each detail record. However, here's a trick to get what you want:
>
>- Create a report variable called rnTotal, set the initial value to 0, the value to store to 0, and the calculate option to SUM
>
>- In the On Exit Expression of the Data Group Footer band, use the following:
>
>
>_VFP.SetVar('rnTotal', rnTotal + orderhdr.totalamt)
>
>
>- In your summary band, use rnTotal as the expression to print and do not put any calculate options on it. Just print it as is.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform