Jump to content
Changes to the Jaspersoft community edition download ×

How to change the color of the text dynamically


swetha reddy

Recommended Posts

Hi,

 

In my report i have change the static text and text fields font color dynamically.

In a row i have to compare two field values and if they are different then i have to change the font color of those fields.

 

For Ex: I have attached a image.

In that image i have pasted a row.

If the values that are shown are different then the Static text (Procedure Code) and the values should be in red.

 

Thanks,

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

You need to implement the 'Print when expression' for all of your fields involved. It may be easier to do this in a scriptlet but you could use something like:

Code:

$F{1}.equals($F{2} ? "regular text" : "<style>text to change</style>"

 

Make sure that you have defined your own style, and that the 'isStyledText' option is set to 'True'.

HTH...

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...