如上所述,如何在分页后添加仅在结尾和表格中可见的行?
是否有任何属性可以用于表格行来指定它是否是页面上的最后一行或第一行?
场景是我需要计算行作为前一列的小计,但这对我来说不适用于表格页脚或表格标题。
<fo:table table-layout="fixed" width="100%" margin-top="1cm">
<fo:table-column column-width="85%"/>
<fo:table-column column-width="14%"/>
<fo:table-column column-width="1%"/>
<fo:table-footer>
<fo:table-row>
<fo:table-cell>
<fo:block>
<fo:retrieve-table-marker retrieve-position-within-table="last-ending" retrieve-class-name="subtotal-caption"/>
</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block>
<fo:retrieve-table-marker retrieve-position-within-table="last-ending" retrieve-class-name="subtotal"/>
</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block></fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-footer>
<fo:table-body>
<fo:marker marker-class-name="subtotal-caption"/>
<fo:marker marker-class-name="subtotal"/>
<fo:table-row>
<fo:table-cell>
<fo:block>
</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block font-weight="bold" text-align="right">
EUR
</fo:block>
</fo:table-cell>
</fo:table-row>
<xsl:for-each select="/document/data/list/invoice/list/position">
<fo:table-row>
<fo:table-cell>
<fo:marker marker-class-name="subtotal-caption">
Zwischenssumme
</fo:marker>
<fo:block>
<xsl:value-of select="name/text()"/>
</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:marker marker-class-name="subtotal">
<xsl:value-of select="amount + sum(preceding::amount/text()) - /document/data/list/invoice/amount/text()"/>
</fo:marker>
<fo:block text-align="right">
<xsl:value-of select="format-number(amount/text(), '###.##0,00', 'european')"/>
</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block text-align="left">
<xsl:if test="vat = 1">
<xsl:value-of select="' *'"/>
</xsl:if>
</fo:block>
</fo:table-cell>
</fo:table-row>
</xsl:for-each>
</fo:table-body>
</fo:table>
我想要收到的是这样的:
但目前的结果是: