How can I use a conditional TextField in JasperReports?
- by Jonas
I would like to have a TextField depenging on a value.
When the value is "0" I would like to hide the TextField.
I.e. I would like to hide the staticText and the textField if the parameter red is equal to "0" in the jrxml-code below:
<staticText>
<reportElement x="100" y="30" width="100" height="30"/>
<text><![CDATA[Red items:]]></text>
</staticText>
<textField>
<reportElement x="200" y="30" width="40" height="30"/>
<textFieldExpression>
<![CDATA[$P{red}]]>
</textFieldExpression>
</textField>
How can I do this?