How can I use a conditional TextField in JasperReports?
Posted
by Jonas
on Stack Overflow
See other posts from Stack Overflow
or by Jonas
Published on 2010-05-12T14:39:17Z
Indexed on
2010/05/12
14:44 UTC
Read the original article
Hit count: 808
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?
© Stack Overflow or respective owner