Jump to content

how to create dynamic background for textfield


venucbv

Recommended Posts

Hi all,

I am new in this jasper reports, i have to change my textfield backgound color dynamically, pls help me.

 

I am using the following code, but its not working.....

 

 

<textField>
                <reportElement mode="Opaque" x="60" y="0" width="150" height="15"/>
                <textElement/>
                <textFieldExpression class="java.lang.String">
                <![CDATA[$F{id}.equals("0052162") ? "<style backcolor='red'>"+ $F{id}+"</style>" : $F{id}]]></textFieldExpression>
 </textField>

 

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

thangalin
Wrote:

Try conditional styles.

 

 

I want 4 different colors to fill a textbox background depending on the inputs.

please give a demo , how to use the conditional styles ?




Post Edited by venucbv at 05/12/2010 04:52
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...