简体   繁体   English

Apache-FOP XSL-FO如何仅在最后一页显示表格页脚

[英]Apache-FOP XSL-FO how do I display the table footer on last page only

I have a data table with a table footer (using the <fo:table-footer> tag). 我有一个带有表尾的数据表(使用<fo:table-footer>标记)。 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). 表格页脚在其中一列中显示数值的总数(这是XML中的预先计算的总数,在XSL样式表中未计算)。 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)? 在我的XSL样式表中,如何告诉表格页脚仅显示在最后一页的表格末尾(即不在每页上,而是仅显示在最后一页的表格末尾)?

Use the table-omit-footer-at-break property on <fo:table> precisely for this purpose: 为此,请精确使用<fo:table>上的table-omit-footer-at-break属性:

Alternatively, just don't use <fo:table-footer> and replace it with another <fo:table-body> . 另外,不要使用<fo:table-footer>并用另一个<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. 我的学生常常惊讶地发现,在一个表中可以包含任意数量的<fo:table-body>元素。 For your solution, just flow another body at the end of your existing body (or bodies) ... don't bother with an actual footer. 对于您的解决方案,只需在现有主体(或多个主体)的末端流动另一个主体即可...不要为实际的页脚烦恼。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM