Jasper Report 显示大量静态文本
任何人都可以建议用我的 JasperReport 解决这个问题吗?我正在使用 iReport 4.4.1 编写一份报告,其中还包含大量静态合同文本,我将其放入 Jasper 模板中的文本框中。
当渲染为 rtf 并在 MS Word 中读取时,文本框正确地从第一页的中间开始,另一个不同的文本框出现在第二页的顶部。两个框中的所有文本都是正确的。
但是,当我在第一页上的文本框顶部插入行时,底部的溢出不会移动到第二页上的框上,它只是消失了。
实际上,我只是希望文本直接进入 Word 文档,而不是文本框内。
我错过了什么吗?
报告样本:
<jasperReport xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="test" language="groovy" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20">
<property name="ireport.zoom" value="1.0"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="259"/>
<queryString language="xPath">
</queryString>
<field name="para1" class="java.lang.String">
<fieldDescription>/study/para1</fieldDescription>
</field>
<background>
<band splitType="Stretch"/>
</background>
<detail>
<band height="802" splitType="Stretch">
<textField isStretchWithOverflow="true">
<reportElement stretchType="RelativeToBandHeight" isPrintRepeatedValues="false" x="5" y="10" width="540" height="512"/>
<textElement/>
<textFieldExpression>$F{para1}</textFieldExpression>
</textField>
</band>
</detail>
<summary>
<band splitType="Stretch"/>
</summary>
</jasperReport>
Can anyone suggest a way around this problem with my JasperReport ? I am using iReport 4.4.1 to write a report that also contains a lot of static contractual text, which I am putting in a text box in the Jasper template.
When rendered into rtf, and read in MS Word, the text box correctly starts half way down the first page, and another different text box appears at the top of the second page. All the text in both boxes is correct.
But when I insert lines at the top of the text box on the first page, the overflow at the bottom does not move onto the box on the second page, it just disappears.
Really I just want the text to go straight into the Word document, not within a text box.
Am I missing something ?
The sample of the report:
<jasperReport xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="test" language="groovy" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20">
<property name="ireport.zoom" value="1.0"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="259"/>
<queryString language="xPath">
</queryString>
<field name="para1" class="java.lang.String">
<fieldDescription>/study/para1</fieldDescription>
</field>
<background>
<band splitType="Stretch"/>
</background>
<detail>
<band height="802" splitType="Stretch">
<textField isStretchWithOverflow="true">
<reportElement stretchType="RelativeToBandHeight" isPrintRepeatedValues="false" x="5" y="10" width="540" height="512"/>
<textElement/>
<textFieldExpression>$F{para1}</textFieldExpression>
</textField>
</band>
</detail>
<summary>
<band splitType="Stretch"/>
</summary>
</jasperReport>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该将
net.sf.jasperreports.export.docx.flexible.row.height
属性添加到带有true
的报表中 值。示例:
有关此属性的更多信息是
You should add the
net.sf.jasperreports.export.docx.flexible.row.height
property to the report with thetrue
value.The sample:
More information about this property is here.