I have to check the value of a variable passed from java and then display data in a text tag conditionally
I have set the java variable to a field as below:
<field name="myField" class="java.lang.String">
<fieldDescription><![CDATA[myVariable]]></fieldDescription>
</field>
I have to print "text1" when value of myFiled is "value1" or "value2". In all other cases i have to display "text2"
I tried using the below in my jrxml:
<text><![CDATA[($F{myField}.equals("value1") || $F{myField}.equals("value2"))?"text1":"text2" ]]></text>
This is just displaying whatever is inside the CDATA as such. Someone please point out what I am doing wrong here.
0 Answers:
No answers yet