grotero Posted September 11, 2006 Share Posted September 11, 2006 Hi! I want to use conditional expression in a textfield expression.Can I use something like this in a textfield expression? if $F{Field}="k" then "g"else $F{Field} Thanks you in advance. Link to comment Share on other sites More sharing options...
bklawans Posted September 11, 2006 Share Posted September 11, 2006 $F{field}.equals("k") ? "g" : $F{field} Link to comment Share on other sites More sharing options...
deepti Posted September 12, 2006 Share Posted September 12, 2006 bklawans wrote:$F{field}.equals("k") ? "g" : $F{field} sir can we use multiple if else in this what u hav repiled ie: $F{field}.equals("k") ? "g" : $F{field} Link to comment Share on other sites More sharing options...
deepti Posted September 12, 2006 Share Posted September 12, 2006 bklawans wrote:$F{field}.equals("k") ? "g" : $F{field} sir can we use multiple if else in this what u hav repiled ie: $F{field}.equals("k") ? "g" : $F{field} Link to comment Share on other sites More sharing options...
vsoneta Posted September 14, 2009 Share Posted September 14, 2009 what if I don't want else then ? I am getting an error if I have it ($F{TR}!=43 ?$F{Product}) What should be the extact syntax Link to comment Share on other sites More sharing options...
walmillard Posted September 16, 2009 Share Posted September 16, 2009 This is standard Java "In Line" IF THEN ELSE StatementThe syntax is IF Condition ? Eval to TRUE : Eval to FALSEThe key parts are the "?" and the ":" Question Mark after the Boolean condition. Colon between the TRUE/FALSE results.You can also nest these statements together egIF Condition1 ? Result 1 TRUE : IF Condition 2 ? Result 2 TRUE : Result 3 FALSEIn anser to your Question you need ELSE! add : and a False result. $F{TR}!=43?$F{Product}:F${TR}You may need to structure your Logic to account for BOTH true and false results.Luck! Link to comment Share on other sites More sharing options...
sanamworld10 Posted January 2, 2017 Share Posted January 2, 2017 I guess you can write something like below in "Text Field Expression" $F{field}.equals("k")? "g" : $F{field} 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