gundinge Posted July 13, 2010 Share Posted July 13, 2010 Hi all, I have a probelm: I want to divide two measures in a crosstab and become an "error evaluating expression" error. I have defined my measures as followed:MS_TURNOVER_EUR_Measure (class: java.math.BigDecimal, value: $F{MS_TU_EUR})MS_TURNOVER_AVG (class: java.math.BigDecimal, value: $F{MS_TU_AVG}) the new text field expression is following: (class: java.math.BigDecimal)($V{MS_TURNOVER_AVG}.compareTo( new java.math.BigDecimal(0.00))== 0 ? $V{MS_TURNOVER_EURMeasure} : $V{MS_TURNOVER_EURMeasure}.divide( $V{MS_TURNOVER_AVG} ))does somebody know where the failure is?many thanks in advanced!here you will find a part of my jrxml: Code: Post Edited by gundinge at 07/13/2010 12:08 Link to comment Share on other sites More sharing options...
lucianc Posted July 16, 2010 Share Posted July 16, 2010 gundingeWrote: I want to divide two measures in a crosstab and become an "error evaluating expression" error. Please post the full exception stacktrace.For one possible cause, read the Javadoc of the BigDecimal.divide method.Regards,Lucian Link to comment Share on other sites More sharing options...
gundinge Posted July 16, 2010 Author Share Posted July 16, 2010 Hi, I already found a solution how it works... I did a typecast from "bigdecimal" to "float" and I used function "msg" and then it will work:($V{MS_TURNOVER_AVG}.compareTo( new java.math.BigDecimal(0.00))== 0 ? "0" : msg("{0,number,##0.0 %}", new Float($V{MS_TURNOVER_EURMeasure}.floatValue() / $V{MS_TURNOVER_AVG}.floatValue())))best regards 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