I have a Title band with a Text Field containing a calculated Variable $V{avg_perc}
. The Text Field has the evaluati
Modify this code based on your requirement
<style name="alternateStyle" fontName="Arial">
<conditionalStyle>
<conditionExpression><![CDATA[new Boolean($V{AMOUNT}.intValue() == 0)]]></conditionExpression>
<style mode="Opaque" backcolor="#FF0000" isBold="true"/>
</conditionalStyle>
</style>
And also refer this link : Link
I finally found the solution for my problem. Adding
<property name="net.sf.jasperreports.style.evaluation.time.enabled" value="true"/>
at the report level causes a Conditional Style to be performed at the moment at which the element is evaluated. See this answer in the Jaspersoft Community for more information.
in your view ireport designer.
click on the field and in the properties panel.: markup = styled selected
Right click on the fied. edit expression:
($F{fila1}.equals("c") ? "<style forecolor='red'>"+ $F{fila1}+"</style>" : $F{fila1})
or xml
<textFieldExpression><![CDATA[($F{fila1}.equals("c") ? "<style forecolor='red'>"+ $F{fila1}+"</style>" : $F{fila1})]]></textFieldExpression>