advait75 Posted June 8, 2011 Share Posted June 8, 2011 Hi,I am a complete newbie. I wanted to know if in iReports it is possible to do something like, if a query returns a certain value(boolean) I can show one image and if another boolean value is returned, I can show another image.E.g. If the query returns Y, a green arrow is shown and if the query returns N, a red arrow is shownIf yes, can someone point me to a tutorial or give me some pointers?Thanks in advance. Link to comment Share on other sites More sharing options...
gilberto.torrezan Posted June 8, 2011 Share Posted June 8, 2011 Hello,You can use the field "Image Expression", when you insert an image object. Using that field, you can insert Java code.You could do something like this:($P{yourReadParameter} ? "green.jpg" : "red.jpeg")or($P{yourReadParameter}.equalsIgnoreCase("y") ? "green.jpeg" : "red.jpeg")(Using that way, the expression class remains java.lang.String) Link to comment Share on other sites More sharing options...
advait75 Posted June 9, 2011 Author Share Posted June 9, 2011 Gilberto,Thanks!!! Works like a charm.... 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