Jump to content
Changes to the Jaspersoft community edition download ×

forecolor of text fields by value of field


2005 IR Help

Recommended Posts

By: leonell - leonell

forecolor of text fields by value of field

2004-10-27 08:38

Hello,

 

please does exist some way how to change color in relation to value of displayed field?

 

For example:

I have set of parts with name and color values.

I need to display the name of part with specified color.

 

There is a way how to make it with the following code:

 

<textField>

<reportElement x="1" y="1" width="268" height="15" forecolor="#000000" backcolor="#FFFF00" mode="Opaque" >

<printWhenExpression>

<![CDATA[new Boolean($F{legendColor}.equals("#FFFF00"))]]>

</printWhenExpression>

</reportElement>

<textElement textAlignment="Center">

<font reportFont="HelveticaNormal"/>

</textElement>

<textFieldExpression>

$F{typeName}

</textFieldExpression>

 

But with this code I need many blocks for many colors.

 

I look for some as:

<reportElement x="1" y="1" width="268" height="15" forecolor="#000000" backcolor="$F{myColor}" mode="Opaque" >

 

Do you have some ideas?

 

Thanks,

L.

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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