Jump to content
We've recently updated our Privacy Statement, available here ×

Conditional Coloring Issue in Jaspersoft Studios


dataentry

Recommended Posts

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

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

 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 + regards

C-Box

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...