prakash.reddy Posted April 22, 2015 Share Posted April 22, 2015 Hi,I'm new to Jasper Reports. I'm using Jasper Studio to create reports and as part of requirement i have to use a variable to get the % of the fields. So added a variable with expression field2/field1 in the expression editor. I'm getting compilation error.The operator / is undefined for the argument type(s) java.math.BigDecimal, java.math.BigDecimal value = ((java.math.BigDecimal)field_TARGET_SUC.getValue()) / ((java.math.BigDecimal)field_TARGET.getValue()); //$JR_EXPR_ID=8$ can any one help me to fix it.I'm not sure what to select for Value Class name for calculations ?thanks Link to comment Share on other sites More sharing options...
nthapa Posted April 22, 2015 Share Posted April 22, 2015 Please refer to this post,http://community.jaspersoft.com/questions/519525/bigdecimal-divisionNote: this is for Bigdecimals, if you have intgers you can achieve this using$F{aFieldName_A}.intValue() / $F{aFieldName_B}.intValue() 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