dataentry Posted August 28, 2019 Share Posted August 28, 2019 I use Jaspersoft studio to create labels for a grocery store. I want to have a text box on the label that has different background colors that correspond to different vendors. I have gotten as far as creating a conditional style, but I do not know how to code the expression for the conditional style so that when a certain vendor name is the in the text box it triggers the conditional style. I know very little about Java so I am at a loss. Any ideas? Thank you in advance. Link to comment Share on other sites More sharing options...
C-Box Posted August 30, 2019 Share Posted August 30, 2019 a typical conditional expression could look like this:$F{vendor}.equals("Microsoft")[/code]this is plain java and means if the content of your database field/column "vendor" is "Microsoft" then it returns true otherwise false.So you just set the background color of the style to red oder something else & check "opaque" (otherwise the background color isn't rendered) and then you set the style to all the textfields that should be colored by the vendor.hth + regardsC-Box 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