jenkins Posted September 25, 2009 Share Posted September 25, 2009 I have the following two fields/variables in my report:$F{CostNeutral}: Field class: java.lang.Integer (0 or 1)$V{persondays}: Field class: java.lang.Integer (calculates the difference between two dates)I now want to enter a third field ($F{PD}: Field class: java.lang.Integer) with an if statement which should check the value in $F{CostNeutral} and then determine how to populate $F{PD}, i.e. with either "0" or "$V{persondays}". I have tried many variations of the following expression with no joy (still have to get up to speed on java!):$F{CostNeutral}.equals( "1" ) ? "0" : "$V{persondays}"Any help would be much appreciated!! Link to comment Share on other sites More sharing options...
iancr01 Posted September 25, 2009 Share Posted September 25, 2009 $F{CostNeutral}.equals( new Integer(1) ) ? new Integer(0) : $V{persondays} Link to comment Share on other sites More sharing options...
jenkins Posted September 25, 2009 Author Share Posted September 25, 2009 works like a charm, cheers! 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