Yossi,
You might be correct, making a pass through the data might be the best solution.
You could use a variable in the report to keep a subtotal, and also have the invoice total on each line of the cursor. And use print when to print the total when they are equal. But that won't work if there is a line item with zero amount at the end of the invoice.
Or, have the total number of invoice lines as a field in the query, and similar strategy as above...comparing lines printed with line total in cursor to trigger whether you are on the last line or not.
>
>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
>
>
Steve Gibson