shining01 Posted November 20, 2013 Share Posted November 20, 2013 Hello,i use Jasperreports 5.2 and iReport 5.5.0. I have to String Fields with numeric values. i would like to calculate this two fields in one variable.My Variable expression is:new Double($F{SUMMEBESTELLMENGE}.toDouble()-$F{BESTAND}.toDouble())Fehler: Error evaluating expression : Source text : new Double($F{SUMMEBESTELLMENGE}.toDouble()-$F{BESTAND}.toDouble())The Report Language is groovy.i have tried also Double.valueOf(Double.valueOf($F{SUMMEBESTELLMENGE}).doubleValue()*Double.valueOf($F{BESTAND}).doubleValue()). but also with error. I call the report in my Java Programm. Link to comment Share on other sites More sharing options...
sambitgudu Posted November 21, 2013 Share Posted November 21, 2013 Change report language type to JAVA Link to comment Share on other sites More sharing options...
shining01 Posted November 21, 2013 Author Share Posted November 21, 2013 Hello everybody, i have found my mistake. There was a null value. Now it works with this syntax:$V{SumErwarteterZugang}-(($F{BESTAND} == null || $F{BESTAND}.length()<=0)?new Double(0.0):Double.parseDouble($F{BESTAND}))-(($F{SUMMEBESTELLMENGE} == null || $F{SUMMEBESTELLMENGE}.length()<=0)?new Double(0.0):Double.parseDouble($F{SUMMEBESTELLMENGE})) Thanks 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