Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

running total in page footer

Status
Not open for further replies.

DanHD

Technical User
Dec 1, 2008
98
NL
hello

In an invoice lay-out/report, I want to use the function 'running total'. In the footer on each page as a totall of that page(carried forwards) and on the next page the same amount in the header (brought forward) and also the same function on the next pages. (for testing I also print the running total on each line)

By testing an invoice: on the first page I have a running total on the latest line of 190 but in the footer is printed 210. On the next page I have in the header 190, thats good. The next line value on the second page is 20. So it seems that the running total in the footer on the first page also takes the first line value on the next page. The same happens on the next pages.
But if I have no order lines on the latest pages, but only some text, then he wil print on the forlast page in the footer the right value but on the latest page by the running total in the header the end value minus the latest orderline value from the forlast page.



Dan
 
You can use a formula for the page header only, like this:

{#runningtotal} - {table.amt}

-LB
 
hi LB

what do you mean with .amt?


Dan
 
Whatever field you are summing in the running total.

-LB
 
The running total in the page header is the first pages oke.
The problem is in the footer, there is the running total not equel to the running total as by the order line.

Dan
 
sorry, I give you a wrong reply.
I'v use the formula and now I've the following situation:

page 1, header --- , latest line 190 , footer 190 , is oke
page 2, header 190 , latest line 990 , footer 990 , is oke
page 3, header 990 , latest line 2428 , footer 2428 , is oke
page 4, header 2428 , latest line 4415 , footer 4320 , is not oke
page 5, header 4320 , some text and the invoice total 4415 , is not oke

So your formula helps on the first pages in the footer, but on the latest pages it's went wrong.

Dan
 
The formula was ONLY for the page header, and so it worked--it looks like the page footer is incorrect. You should just be using the running total by itself in the page footer, and if that is incorrect, then the running total is set up incorrectly.

-LB
 
hoi LB

I've tried some and it works oke, but I can't explain it, can you?
(I hate it when I do something and I don't understand why)

in the footer:
if pagenumber = (TotalPageCount-1)
then {#runningtotal}
else
{#runningtotal}-{@linetotal}

and in the header:
if pagenumber = TotalPageCount
then {#runningtotal}
else {#runningtotal}- {@linetotal}

Dan
 
What are you using {@linetotal} for? What is the content of this formula?

-LB
 
It's count the valuta against the rate.

Dan
 
Please show the actual content of the formula, as I think this is affecting your results.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top