使用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)我想要的方式:
2)给出xnodepath后:
3)xnode:
道歉,如果遗漏了。
答案 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>