How to hide/print Detail band at report with condition based on field's value?

Viewed 2152

I want to print my detail band with expression based on field value but seems not working. I've tried:

new.java.lang.Boolean($F{Code}.equals("COD"))

new Boolean($F{Code}.equals("COD"))

$F{Code}.equals("COD")

$F{Code}  == "COD"

Any idea to make it works?

<band height="60">
        <printWhenExpression><![CDATA[$F{Code}.equals("COD")]]></printWhenExpression>
        <staticText>
            <reportElement x="370" y="20" width="100" height="30" uuid="dd9cb634-244f-4dd4-b329-4c90e406afba"/>
            <text><![CDATA[One Detail]]></text>
        </staticText>
    </band>
    <band height="56">
        <staticText>
            <reportElement x="370" y="20" width="100" height="30" uuid="d4259182-215b-4b3e-9673-bcd6cb5ac355"/>
            <text><![CDATA[Another detail]]></text>
        </staticText>
    </band>
0 Answers
Related