I am printing invoices where the detail band may extend over serveral pages. In the page footer, there is a tear off receipt with includes the invoice total, exactly as it is calculated in the group total. Problem is on all the pages except the last the total is incorrect, reflecting only the total on that page.
I want to use the on entry or on exit band events to get the total for the group and the count of number of line items and display it accurately in the page footer. Having trouble with the syntax.
Originally was trying a UDF which did a
SELECT SUM(line_total) from line_items WHERE
GROUP BY invoice_number INTO ARRAY lajunk
RETURN ljunk(1)
That wasn't doing it.
Then tried fsum=SUM(line_items) in the on entry band event and got and error that it could not find sum.prg
Have also tried variations of COUNT TO without knowing how to filter for the values in this band (i.e. invoice_number)
Obviously, floundering. Think I used to know how to do this.
Guidance appreciated.
Charles Hankey
Though a good deal is too strange to be believed, nothing is too strange to have happened.
- Thomas Hardy
Half the harm that is done in this world is due to people who want to feel important. They don't mean to do harm-- but the harm does not interest them. Or they do not see it, or they justify it because they are absorbed in the endless struggle to think well of themselves.
-- T. S. Eliot
Democracy is two wolves and a sheep voting on what to have for lunch.
Liberty is a well-armed sheep contesting the vote.
- Ben Franklin
Pardon him, Theodotus. He is a barbarian, and thinks that the customs of his tribe and island are the laws of nature.