Gorrex Posted March 21, 2008 Share Posted March 21, 2008 I'm trying to use a conditional in a variable's expression field. This is what I have: $V{FieldName}.intValue() = 0 ? ($V{FieldName}.movePointLeft( 2 )).divide($V{FieldName}.movePointLeft( 2 ),6,RoundingMode.UP) : null I'm getting this as an error: 1. The left-hand side of an assignment must be a variable value = (java.math.BigDecimal)(((java.math.BigDecimal)variable_FieldName.getValue()).intValue() = 0 ? (((java.math.BigDecimal)variable_FieldName.getValue()).movePointLeft( 2 )).divide(((java.math.BigDecimal)variable_FieldName.getValue()).movePointLeft( 2 ),6,RoundingMode.UP) : null);//$JR_EXPR_ID=15$ I am rather new to java and coding in general any help would be greatly appreciated. Link to comment Share on other sites More sharing options...
dnvsrikanth Posted March 21, 2008 Share Posted March 21, 2008 Hi Gorrex, Use equal-to(==) operator rather than assignment operator(=) Code:$V{FieldName}.intValue() == 0 ? ($V{FieldName}.movePointLeft( 2 )).divide($V{FieldName}.movePointLeft( 2 ),6,RoundingMode.UP) : null Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now