XSl-FO重复表中的值 - 版本1.0

时间:2016-01-18 12:04:03

标签: xsl-fo

使用xsl-fo创建一个将根据FO文件生成PDF文件的报告。 问题: 如果你看到下面的代码,我创建了带有列和行分隔符的详细区域(网格视图,框架是)。 它的工作正常但每当我使用XML节点路径并给出细节区域的路径时,TOTAL(它的一行)会在每个记录之后重复,如图所示。 我想要一些能阻止他们重复的事情。

void PObj::process()
{
    while(!terminateFlag)
    {
        sleep(1);

        //do work and set text
         std::string text = "bla";
         emit setText( text );
    }
}

1)我想要的方式:

enter image description here

2)给出xnodepath后:

enter image description here

3)xnode:

enter image description here

道歉,如果遗漏了。

1 个答案:

答案 0 :(得分:1)

我对您使用的软件不熟悉,因此我不知道该怎么做,但您需要将第二个fo:table-row移出xsl:for-each

<xsl:for-each  select="DOCUMENT/ROWSET/ROW[count(. |             key('bykey1453107264684', ORDER_ID)[1]) = 1]">
  <fo:table-row  keep-with-next="always"  background-color="#ffffff"  height="3.43cm"   >
    <fo:table-cell>
      <!-- b7241a65976545a29cb3adaf7e81d5ab -->
      <fo:block  keep-together="always"><xsl:value-of select="LINE_NO"></xsl:value-of></fo:block>
    </fo:table-cell>
    <fo:table-cell  >
      <!-- 6193eb7f045b4c7f84a62ec78f9b8610 -->
      <fo:block    keep-together="always" ><xsl:value-of select="PARTICULAR"></xsl:value-of></fo:block>
    </fo:table-cell>
    <fo:table-cell >
      <!-- b851391f97d943ae8ea9ad24544887fd -->
      <fo:block  keep-together="always"><xsl:value-of select="TOTAL_AMT">               </xsl:value-of></fo:block>
    </fo:table-cell>
    <fo:table-cell>
    <fo:block></fo:block>        </fo:table-cell>
  </fo:table-row>
</xsl:for-each>
<fo:table-row keep-together="always" >
  <fo:table-cell  >
  <fo:block></fo:block>        </fo:table-cell>
  <fo:table-cell  >
    <!-- 6a4ae7636f7240cfb324c03b7ff502ac -->
    <fo:block   keep-together="always">Total</fo:block>
  </fo:table-cell>
  <fo:table-cell  >
    <!-- efcabc0ed27b4db397079743e4caee5f -->
    <fo:block  keep-together="always"><xsl:value-of select="LINE_TOTAL_AMT"></xsl:value-of></fo:block>
  </fo:table-cell>
  <fo:table-cell>
  <fo:block></fo:block>        </fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
</xsl:if>


<!-- END Area Detail -->
</fo:block>
</fo:table-cell>
</fo:table-row>