venucbv Posted May 11, 2010 Share Posted May 11, 2010 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 More sharing options...
thangalin Posted May 11, 2010 Share Posted May 11, 2010 Try conditional styles. Link to comment Share on other sites More sharing options...
venucbv Posted May 12, 2010 Author Share Posted May 12, 2010 thangalinWrote: 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now