andrey_nado Posted March 23, 2010 Share Posted March 23, 2010 Hi!I need to create text elements with background color specified in runtime. I'm trying to use styled text elements and specify "backcolor" attribute in "style" element within text expression (see sample code).Unfortunately backcolor is only displayed under text, entire element box is not filled by desired color. How can I make JasperReports to fill entire box?ThanksCode:<textField> <reportElement x="0" y="0" width="100" height="20" /> <textElement isStyledText="true" /> <textFieldExpression class="java.lang.String"> <![CDATA["<style forecolor=\"red\" backcolor=\"blue\">Sample Text</style>"]]> </textFieldExpression></textField> Link to comment Share on other sites More sharing options...
andrey_nado Posted March 25, 2010 Author Share Posted March 25, 2010 Any ideas?My only idea is to put behind the text an box with dynamically created image of desired size & color. I'm afraid resulting documents may become too heavy for their viewers. Link to comment Share on other sites More sharing options...
damiankober Posted September 22, 2010 Share Posted September 22, 2010 there is a scriplet approach Teodor posted herehttp://jasperforge.org/plugins/espforum/view.php?group_id=102&forumid=103&topicid=73973 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