Jump to content
JasperReports Library 7.0 is now available ×

the way to change FORECOLOR ?


2006 IR Open Dicussion

Recommended Posts

By: Rick62 - rick62

the way to change FORECOLOR ?

2006-06-08 01:48

Hi all,

is there somebody who knows how to change FORECOLOR of displayed DATA ?

Which is the correct coding ?

Something like :

$F{quantity}.doubleValue() < 100 ? setForecolor(255,0,0):setForecolor(0,0,0)

The purpose is to color data in red in one case and in black in other case, dynamically.

(I've already used the method with 2 textfield overlapped and the printWhenExpression but it is not the best solution).

Someone can help me ?

Thanks for your answers.

 

 

 

 

 

By: Bat(ch)man - dekit

RE: the way to change FORECOLOR ?

2006-06-08 03:07

The printWhenExpression is the way to go. Should work out, even for you

 

 

 

 

By: Rick62 - rick62

RE: the way to change FORECOLOR ?

2006-06-08 05:42

This is a solution which works, I know, I've used it.

But not easy to modify if you have a lot of textfields.

I think that my proposal :

$F(myValue) < 0 ? setForecolor(red):setForecolor(black)

would be more simple.

So, which is the correct coding in this case ?

 

 

 

 

 

By: Armandor - armandor777

RE: the way to change FORECOLOR ?

2006-06-08 11:26

I have a similar problem, but I´m using the numbers of a string data.

 

 

 

 

By: Rick62 - rick62

RE: the way to change FORECOLOR ?

2006-06-13 08:09

I've got THE solution.

Write the conditional sentence in this way, for exemple :

($F{quantity} < 100)?

("<style forecolor="red">" + $F{quantity}.toString()+ "</style>"):

($F{quantity}.toString())

... and it works.

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Days

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