I want to set a property for a textField element in the jrxml file.
I have read the answer here and I would like to set the net.sf.jasperreports.text.save.line.breaks property in TextField as mentioned in the comments.
I have tried:
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElementx="409" y="170" width="300" height="14"/>
<textElement>
<font fontName="Courier New" size="8"/>
</textElement>
<property name="net.sf.jasperreports.text.save.line.breaks" value="true"/>
<textFieldExpression class="java.lang.String"><![CDATA[$F{field}]]></textFieldExpression>
</textField>
But the compiler says:
Invalid content was found starting with element 'property'
What is the correct way?
The property
element needs to go in reportElement
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement key="textField-2" positionType="Float" x="409" y="170" width="300" height="14" stretchType="RelativeToTallestObject" isPrintWhenDetailOverflows="true">
<property name="net.sf.jasperreports.text.save.line.breaks" value="true"/>
</reportElement>
...