보고서 서식을 지정하려고하는데 다양한 항목/수수료가있는 여러 페이지에 걸쳐있는 테이블이 있습니다. 이상적으로하고 싶은 것은 테이블 바닥 글의 각 페이지에 대해 누적 합계를 표시하는 것입니다. 내 테이블의 값을 현재 페이지에서 첫 페이지로 다시 합하여 아래쪽에 표시합니다. 이것을 달성 할 수있는 방법이 있습니까?XSLT/XSL FO에서 누적 합계를 표시 할 수 있습니까?
<fo:table width="100%" border-style="groove" border-width="2pt" background-repeat="repeat">
<fo:table-column column-width="5%" />
<fo:table-column column-width="60%" />
<fo:table-column column-width="5%" />
<fo:table-column column-width="7.5%" />
<fo:table-column column-width="7.5%" />
<fo:table-column column-width="7.5%" />
<fo:table-column column-width="7.5%" />
<fo:table-footer border-top-style="dashed" border-bottom-style="dashed">
<fo:table-cell display-align="center">
</fo:table-cell>
<fo:table-cell display-align="center">
<fo:block text-align="center">
Page <fo:page-number/>
<xsl:text> OF </xsl:text>
<fo:page-number-citation ref-id="end" />
</fo:block>
</fo:table-cell>
<fo:table-cell display-align="center">
</fo:table-cell>
<fo:table-cell display-align="center">
</fo:table-cell>
<fo:table-cell display-align="center">
</fo:table-cell>
<fo:table-cell display-align="center">
<fo:block text-align="end">
Page Total:
</fo:block>
</fo:table-cell>
<fo:table-cell display-align="center">
</fo:table-cell>
</fo:table-footer>
<fo:table-body>
<xsl:for-each select="/receipt_invoice/details/product_lot">
<xsl:variable name="untitled" select="." />
<fo:table-row>
<fo:table-cell border-style="solid" border-width="1pt" border-color="black" padding="2pt" background-repeat="repeat" display-align="center">
<fo:block text-align="right">
<fo:block>
<xsl:value-of select="lot/quantity" />
</fo:block>
</fo:block>
</fo:table-cell>
<fo:table-cell border-style="solid" border-width="1pt" border-color="black" padding="2pt" background-repeat="repeat" display-align="center">
<fo:block>
<fo:table width="100%" border-style="none" border-width="2pt" background-repeat="repeat">
<fo:table-column/>
<fo:table-column/>
<fo:table-body>
<fo:table-row>
<fo:table-cell border-style="none" border-width="2pt" padding="2pt" background-repeat="repeat" display-align="before">
<fo:block>
<fo:block>
<xsl:value-of select="product/code" />
</fo:block>
<fo:block>
Lot Qty:
<xsl:value-of select="lot/quantity" />
</fo:block>
<fo:block>
<xsl:text>
 
</xsl:text>
</fo:block>
<fo:block>
<xsl:value-of select="lot/identifier" />
</fo:block>
<fo:block>
<xsl:value-of select="lot/lot_components/component/label" />
</fo:block>
<fo:block>
<xsl:value-of select="lot/lot_components/component/value" />
</fo:block>
</fo:block>
</fo:table-cell>
<fo:table-cell border-style="none" border-width="2pt" padding="2pt" background-repeat="repeat" display-align="before">
<fo:block>
<fo:block>
<xsl:value-of select="product/first_description" />
</fo:block>
<fo:block>
<xsl:value-of select="lot/csd/csd_line" />
</fo:block>
<fo:block>
<xsl:value-of select="lot/csd/set_description" />
</fo:block>
<fo:block>
<xsl:value-of select="lot/lot_components/component/label" />
</fo:block>
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
Line Number:
<xsl:value-of select="line_number" />
</fo:block>
</fo:table-cell>
<fo:table-cell border-style="solid" border-width="1pt" border-color="black" padding="2pt" background-repeat="repeat" display-align="center">
<fo:block text-align="center">
<fo:block>
<xsl:value-of select="product/unit_of_measure" />
</fo:block>
</fo:block>
</fo:table-cell>
<fo:table-cell border-style="solid" border-width="1pt" border-color="black" padding="2pt" background-repeat="repeat" display-align="center">
<fo:block text-align="center">
<fo:block>
<xsl:value-of select="stock_charges/storage_rate" />
</fo:block>
</fo:block>
</fo:table-cell>
<fo:table-cell border-style="solid" border-width="1pt" border-color="black" padding="2pt" background-repeat="repeat" display-align="center">
<fo:block text-align="center">
<fo:block>
<xsl:value-of select="stock_charges/storage_amount" />
</fo:block>
</fo:block>
</fo:table-cell>
<fo:table-cell border-style="solid" border-width="1pt" border-color="black" padding="2pt" background-repeat="repeat" display-align="center">
<fo:block text-align="center">
<fo:block>
<xsl:value-of select="stock_charges/handling_rate" />
</fo:block>
</fo:block>
</fo:table-cell>
<fo:table-cell border-style="solid" border-width="1pt" border-color="black" padding="2pt" background-repeat="repeat" display-align="center">
<fo:block text-align="center">
<fo:block>
<xsl:value-of select="stock_charges/handling_amount" />
</fo:block>
</fo:block>
</fo:table-cell>
</fo:table-row>
</xsl:for-each>
</fo:table-body>
</fo:table>
수정 :
는 그래서 각 페이지의 소계를 표시 할 페이지 바닥 글을 사용하기로 결정했고, 단순히 그것을 테스트하는 총계를 반환 내 테이블에 마커를 설정 한 하지만 내 생각은 어떻게 든 내 XML의 위치가 노드에서 촬영과 같은 것을 사용 된 파일을 얻기 위해 시도 할 수 있다는이었다 지금 무엇을 ... 값이 실제로 충전의 이름이됩니다
<xsl:value-of select="sum(preceding::value[the_position]"/>
이 모든 것이 효과가 있을까요? 다른 일을 시도해 왔지만 신택스와 위치를 반환하는 방법에 대해 확실하지 않은 경우.
처음과 같이 들립니다. http://stackoverflow.com/questions/7931266/how-can-i-sum-up-some-values-per-page-in-a-table-in-xsl-fo – Tomalak
XML에서 XSL 로의 변환에서 이전 값을 합산 할 수 있습니다 (해당 데이터가 소스에없는 경우). 마커를 넣고 retrieve-table을 사용할 수 있습니다 ('fo : retrieve-table-marker />'사용). -marker (모든 FO 엔진 지원이 아닌 XSL FO 1.1 구조입니다). 마커를 테이블 바닥 글로 가져옵니다. 이 문제는 때로는 테이블 끝에서 원하지 않고 테이블 바닥 글을 사용하면 FO 엔진에 마지막 테이블 바닥 글이나 무언가를 생략 할 수있는 옵션이없는 한 가져 오는 것을 의미합니다. –
고마워요 Tomalak, 적어도 유망 해 보입니다. 불행히도 저는 여러 솔루션을 가진 테이블 바닥 글을 완벽하게 지원하지 않고 테이블을 지원하지 않는 Apache FOP를 사용하여 인쇄 할 솔루션을 설계하고 있습니다. 그러나 마커를 사용하면 어떤 문제 해결 방법을 알게된다면 큰 도움이 될 것입니다. – adam5990