gervor Posted August 10, 2009 Share Posted August 10, 2009 Hi all..I have a textfield and I want to set the backColor from a paramater.I know this works in the text field expression:"<style backcolor='"+$P{thisColor}+"'>"+$P{categoryName}+"</style>"The problem with the above is that only the text itself has the correct backcolor. I want the whole textfield width to have the backcolor.I can force my categoryName parameter to have some spaces after it, that looks fine in the preview, but when I open the generated pdf, then you dont see the extra spaces anymore.Why is this?So basically, is it possible to set a backcolor on the reportElement with something like this:<reportElement isPrintRepeatedValues="false" mode="Opaque" x="0" y="0" width="495" height="18" backcolor="$P{thisColor}"/>Thanks in advance..Post Edited by gervor at 08/10/2009 09:40 Link to comment Share on other sites More sharing options...
rwolverton Posted August 10, 2009 Share Posted August 10, 2009 I solved this problem by using rectangles behind the text field and a print when statement. Not elegant but pretty easy and provides good control. Link to comment Share on other sites More sharing options...
gervor Posted August 11, 2009 Author Share Posted August 11, 2009 Thanks for the info.Did you also set the backcolor of the rectangle using a parameter of field, if so, please can you show me how you did it?Regards 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