Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Total on last detail line
Message
From
15/05/2005 13:21:25
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
15/05/2005 11:10:19
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01014348
Message ID:
01014362
Views:
19
>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)
Previous
Reply
Map
View

Click here to load this message in the networking platform