Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Total on last detail line
Message
De
15/05/2005 13:21:25
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
15/05/2005 11:10:19
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01014348
Message ID:
01014362
Vues:
21
>Hi All:
>
>How can I produce a report that has total information on the last detail line?
>
>Easy Report to do for invoices with multiple line items:
>
>
>Invoice Number  Amount
>10001           1,000
>                2,000
>                3,000
>TOTAL           6,000
>
>10002           4,000
>
>10003           5,000
>                6,000
>TOTAL          11,000
>
>GRAND TOTAL    21,000
>
>
>This I can't do, unless I run one pass through the file and mark each last line:
>
>
>Invoice Number  Amount  Total
>10001           1,000
>                2,000
>                3,000   6,000
>
>10002           4,000   4,000
>
>10003           5,000
>                6,000  11,000
>
>GRAND TOTAL            21,000
>
In general, preparing all the data beforehand (in a cursor) seems a sensible approach. An alternative is to have a UDF that looks ahead at the next record, to see if there is a change in a certain key expression. But I would prefer preparing all the data beforehand.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform