Forum How do I...?

Carry over sums on invoices

twantzen
Hi all!

Can anybody give me a clue on how to implement carry over sums (I hope this is the correct English term, in German it would be "Übertrag") from one page to the other in an invoice HTML template? Is this possible with PrinceXML and how?

Thanks,
Tobias
howcome
Would you like to sum line items on each page? Could you post a sample PDF which demonstrates what you are looking for?

Edited by howcome

twantzen
@howcome Here’s a PDF of an invoice. I marked the "carry over sums" with magenta colored arrows.
  1. sample-invoice-with-carry-over.pdf270.7 kB

Edited by twantzen

howcome
I've added an example here:

https://css4.pub/2023/boxtracking/#subtotals

This solution uses the boxtracking API an adds deferred floats to the top/bottom of pages. This way, the table itself is unchanged.

An alternative approach is to add rows to the table, to hold the subtotals and (on the next page) the carryovers. However, this is tricky as one needs to reformat the document for each row insertion, and page breaks can sometimes be unpredictable when new content is added.

Edited by howcome