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="para开发者_Go百科1" 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>
You should add the net.sf.jasperreports.export.docx.flexible.row.height
property to the report with the true
value.
The sample:
<?xml version="1.0" encoding="UTF-8"?>
<jasperReport ...>
<property name="ireport.zoom" value="1.0"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="0"/>
<property name="net.sf.jasperreports.export.docx.flexible.row.height" value="true"/>
More information about this property is here.
精彩评论