Jump to content

variable expression not working in ireport 3.7.4


bentong

Recommended Posts

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...