0

I have a data table with a table footer (using the <fo:table-footer> tag). The table footer displays the total of the numeric values in one of one the columns (this is a pre-calculated total in the XML, it is not calculated in the XSL stylesheet). When the table fits on one page it works well. The table footer appears at the foot of the table as expected. When the table is too long to fit on one page I get a table footer at the bottom of the table on EACH page. This looks weird and instead I want the total value for the whole column to only appear at the end of the table on the last page only.

In my XSL stylesheet, how do I tell the table footer to only display at the end of the table on the last page (ie. not on each page, but only at the end of the table on the last page)?

1 Answers1

1

Use the table-omit-footer-at-break property on <fo:table> precisely for this purpose:

Alternatively, just don't use <fo:table-footer> and replace it with another <fo:table-body>. Often my students are surprised to learn that you can have any number of <fo:table-body> elements in a single table. For your solution, just flow another body at the end of your existing body (or bodies) ... don't bother with an actual footer.

G. Ken Holman
  • 4,333
  • 16
  • 14
  • Thanks - `table-omit-footer-at-break="true"` worked perfectly. I didn't know I could have any number of table body elements though. That's something I'll explore in the future. A very useful tip! – Rob Weddell Sep 26 '13 at 15:06
  • Since in XSL-FO there are two ways to populate a table body (either the row-based row-grouping method or the cell-based row-grouping method), you need to be able to have multiple bodies so that each portion of your table can be built using the most appropriate scheme for your data. – G. Ken Holman Sep 26 '13 at 15:08