如何防止JasperReports TextField中的重复数据 [英] How to prevent repeating data in JasperReports TextField
问题描述
我正在使用 JasperReports 并且在下一页继续使用textField数据时出现问题。
我有3个textField详细信息。
Band splitType =Stretch。
每个textfiled都有边框,isPrintWhenDetailOverflows param设置为true。
当textfield中的数据不适合页面时,它继续下一步。所以我需要打印相同波段的其他文本(因为我需要打印每个文本字段的边框)
但isPrintWhenDetailOverflows =true也导致在第二页上的其他文本字段中重复数据,尽管它们的内容适合第一页。
I am using JasperReports and have some problem with textField data continue on next page.
I have 3 textField in detail band.
Band splitType="Stretch".
Every textfiled has borders and isPrintWhenDetailOverflows param set "true".
When data in textfield does not fit on page it continues on next. So i need to print other textfileds of same band (because i need to print borders of every textfield)
But isPrintWhenDetailOverflows="true also leads to repeating data in other textfields on second page though their contents fits on first page.
插图:
推荐答案
jasper报告文档说:
The jasper report documentation says:
isPrintWhenDetailOverflows()
If this is set to true, the element will be reprinted on the next page if the band does not fit in the current page.
所以我认为这可能是一个问题。删除 isPrintWhenDetailOverflows =true
。两件事 isStretchWithOverflow =true
和 在这种情况下,stretchType =RelativeToTallestObject
正在为我工作。所以你的 textField
将如下:
So I think it might be a problem. Remove isPrintWhenDetailOverflows="true"
. The two things isStretchWithOverflow="true"
and stretchType="RelativeToTallestObject"
are working for me in this case. So your textField
will be like:
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement style="cell" stretchType="RelativeToTallestObject" x="266" y="0" width="266" height="15"/>
<textElement textAlignment="Left" verticalAlignment="Middle">
<font fontName="Arial" size="9" isBold="false" pdfEncoding="Cp1251" isPdfEmbedded="true"/>
<paragraph leftIndent="2"/>
</textElement>
<textFieldExpression><![CDATA[$F{structure}]]></textFieldExpression>
</textField>
这篇关于如何防止JasperReports TextField中的重复数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!