In my Jaspersoft Studio template I have elements like:
Number: $F{number}
Description: $F{description}
Code: $F{code}
Purpose $F{purpose}
...
number, description,code, purpose, etc.
being string variables whose values come from a dto, while on the left there’s only static content. In case one of these values is a long string, I need for the elements below to slide down the page without changing mutual distances, font dimensions, etc, i.e.:
I’m using the positionType
attribute of the <reportElement>
and the text on the right correctly expands to the line below, but the other elements don’t move down so the outcome is an overlap of the value strings in the final pdf:
How can I modify the jrxml file to get the effect I want?
In the jrxml template, after the definition of the variables at the beginning of the file:
<field name="number" class="java.lang.String">
<fieldDescription><![CDATA[Number]]></fieldDescription>
</field>
...
The rest of the template goes:
<background>
<band splitType="Stretch"/>
</background>
<detail>
<band height="213" splitType="Prevent">
<staticText>
<reportElement x="-10" y="86" width="138" height="14" uuid="55616a5b-e0f9-469d-9c48-aee84c9fc3f0"/>
<textElement textAlignment="Left">
<font size="10.5" isBold="false" isItalic="false"/>
<paragraph lineSpacing="Fixed" lineSpacingSize="14.0"/>
</textElement>
<text><![CDATA[Number:]]></text>
</staticText>
<textField textAdjust="ScaleFont" isBlankWhenNull="true">
<reportElement x="129" y="86" width="410" height="14" uuid="5f5e6d3c-03d4-42fe-b1e9-1c7c9a71cbc0"/>
<textElement>
<font size="11"/>
</textElement>
<textFieldExpression><![CDATA[$F{number}]]></textFieldExpression>
</textField>
...
Thanks in advance for any help I can get 🙂 .