I'm trying to conditionally format a value on my report if it is negative but I am not able to evaluate if a value is less than Zero or not.
I'm still new to Jaspersoft. Here is my custom formatting method.
<style name="NegativeAverage"> <conditionalStyle> <conditionExpression> <![CDATA[new Boolean($F{AVERAGE_BALANCE} < 0.00 ? Boolean.TRUE : Boolean.False]]> </conditionExpression> <style isBold="true"/> </conditionalStyle> </style>
Errors:
Errors were encountered when compiling report expressions class file: 1. Syntax error, insert ")" to complete Expression value = new Boolean(((java.math.BigDecimal)field_AVERAGE_BALANCE.getValue()) < 0.00 ? Boolean.TRUE : Boolean.False; //$JR_EXPR_ID=14$ <---> 2. Syntax error, insert ")" to complete Expression value = new Boolean(((java.math.BigDecimal)field_AVERAGE_BALANCE.getOldValue()) < 0.00 ? Boolean.TRUE : Boolean.False; //$JR_EXPR_ID=14$ <---> 3. Syntax error, insert ")" to complete Expression value = new Boolean(((java.math.BigDecimal)field_AVERAGE_BALANCE.getValue()) < 0.00 ? Boolean.TRUE : Boolean.False; //$JR_EXPR_ID=14$ <---> 3 errors
Any help is greatly appreciated.