ico.gnito Posted November 7, 2015 Share Posted November 7, 2015 I am desperately trying to format the Field "FilmID" based on it's value. Could you provide me with a conditional expression to format values >= 3 in red color ?I am now trying to use conditional formatting on a text string: $F{FilmName} == "Jurassic Park". This has no effect!Thanks a lot in advance! <style name="Style2"> <conditionalStyle> <conditionExpression><![CDATA[$F{FilmName} == "Jurassic Park"]]></conditionExpression> <style mode="Opaque" backcolor="#3470E0"/> </conditionalStyle> </style>*EDIT* I finally figured it out: Operators like == are for numerical values and for strings I use .equals(""). Conditional Formatting in Jasper is complicated^^. Funnily != works for a string. So if I use Field == "ABC" it doesn't work but if I use Field != "ABC" it works. And if I use Field .equals("ABC") it also works. Link to comment Share on other sites More sharing options...
ernst_2 Posted November 9, 2015 Share Posted November 9, 2015 try $F{FilmName}.equals("Jurassic Park")Edit: Sorry, I didn’t notice that you find the solution yourselfAnd != works, because the object references are not the same 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