Java 如果 jasper 报告中的数据溢出,则拉伸一行
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1205410/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Stretch a row if data overflows in jasper reports
提问by
how do i stretch a row when data overflows the band height in jasper reports, I have set the stretch with overflow flag as true but it doesn't work.
当数据溢出 jasper 报告中的频带高度时,我如何拉伸一行,我已将溢出标志的拉伸设置为 true 但它不起作用。
回答by rics
My band stretches if necessary with the following conditions, I do not know yours. I have started with the ireport 1.0 netbeans plug-in and jasper 3.5.2. The Split type for the band has been set to Stretch.
如有必要,我的乐队会根据以下条件进行拉伸,我不知道您的情况。我已经开始使用 ireport 1.0 netbeans 插件和 jasper 3.5.2。乐队的拆分类型已设置为拉伸。
<band height="108" splitType="Stretch"></band>
The Stretch with overflow for the field has been checked, e.g.:
已检查该字段的 Stretch with overflow,例如:
<textField isStretchWithOverflow="true">
<reportElement positionType="Float" x="70" y="28" width="485" height="14"/>
<textElement>
<font size="10"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[($F{EQUIPMENTS} == null ? "-" : $F{EQUIPMENTS})]]></textFieldExpression>
</textField>
回答by mike
I ran into this problem myself. I could not get the detail band to stretch, even though the text field in the band was configured to do so. The problem was with the report's Print Orderproperty, which for some reason had been set to horizontal. When I changed it to vertical, the problem went away.
我自己遇到了这个问题。我无法拉伸细节带,即使带中的文本字段配置为这样做。问题出在报告的Print Order属性上,由于某种原因,该属性已设置为horizontal。当我将其更改为vertical 时,问题就消失了。
According to the JasperReports Ultimate Guide,
根据 JasperReports 终极指南,
When filling report templates horizontally, dynamic text fields inside the detail section no longer stretch to their entire text content, because this might cause misalignment on the horizontal axis of subsequent detail sections.
水平填充报表模板时,详细信息部分内的动态文本字段不再延伸到其整个文本内容,因为这可能会导致后续详细信息部分的水平轴未对齐。
回答by lwpro2
isn't that set the height enough tall, and the property overflow, then it will automatically overflow to multiple rows? such solution works for me.
那是不是把高度设置的够高,属性溢出,然后自动溢出到多行?这样的解决方案对我有用。