bentong Posted August 10, 2010 Share Posted August 10, 2010 (($F{field1}.doubleValue() + $F{field2}.doubleValue() + $F{field3}.doubleValue() + $F{field4}.doubleValue() + $F{field5}.doubleValue())/5) Post Edited by paltakmo at 08/10/2010 09:39 Link to comment Share on other sites More sharing options...
bentong Posted August 10, 2010 Author Share Posted August 10, 2010 is this a bug of ireport 3.7.4 or my expression is not correct? Link to comment Share on other sites More sharing options...
dnewsom Posted August 10, 2010 Share Posted August 10, 2010 What is happening with the issue? The variable looks like it could work depending on the values of the fields. Link to comment Share on other sites More sharing options...
robsil Posted August 10, 2010 Share Posted August 10, 2010 new Double(($F{field1}.doubleValue() + $F{field2}.doubleValue() + $F{field3}.doubleValue() + $F{field4}.doubleValue() + $F{field5}.doubleValue())/5)) Edit: Actually you shouldn't trust the values to be non-null... so....new Double(($F{field1} == null?0.0:$F{field1}.doubleValue()) +($F{field2} == null?0.0:$F{field2}.doubleValue()) +($F{field3} == null?0.0:$F{field3}.doubleValue()) +($F{field4} == null?0.0:$F{field4}.doubleValue()) +($F{field5} == null?0.0:$F{field5}.doubleValue()))Post Edited by robsil at 08/10/2010 19:07 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