emrah.karakoc Posted February 22, 2013 Share Posted February 22, 2013 Hello,i am using iReport Dedigner and trying to make a Crosstab. If have a boolean variable on my table. It will be shown just true or false. but i want to see "ok" if it is true, and "not ok" if it is false. How can i do that?sorry, but i am a beginner :) Thanks! Link to comment Share on other sites More sharing options...
Solution kcollins Posted February 22, 2013 Solution Share Posted February 22, 2013 You may be able to use a ternary (? :) operator for that. It would be something like:$V{bool_var} == Boolean.TRUE ? "ok" : "not ok"The only problem with this is that it will evaluate to "not ok" for any value other than true. So, for example if there is no value for the variable at all, it will evaluate to "not ok". This may work in your case though. -Kris Link to comment Share on other sites More sharing options...
emrah.karakoc Posted February 23, 2013 Author Share Posted February 23, 2013 but i want to have it blank if there is no value? wouldnt "blank if null" help me in this case? or that i can put a third condition to $V{bool_var} == Boolean.TRUE ? "ok" : "not ok"? :) Thanks your answer Link to comment Share on other sites More sharing options...
marianol Posted February 25, 2013 Share Posted February 25, 2013 Blank if null will not help you here since you have the ternary expresion there so it will always be a value, you will either render "OK" or "not ok". For using the blank if null you will need to add a second expresion that checks for the actual false value and if is neither true or false will just print the value Something like: $V{bool_var} == Boolean.TRUE ? "ok" : ( $V{bool_var} == Boolean.FALSE ? "Not ok" : $V{bool_var} ) Link to comment Share on other sites More sharing options...
emrah.karakoc Posted February 28, 2013 Author Share Posted February 28, 2013 but i have already a print when expression, which is "$V{serverUrl} != null" ? how can i combinate it with "ok" and "not ok" expression? Link to comment Share on other sites More sharing options...
sumate.sdk Posted August 30, 2022 Share Posted August 30, 2022 I have to use an image instead of String, Can it be done like that? 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