Jump to content

Background color in styled text elements


andrey_nado

Recommended Posts

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?

Thanks

Code:
<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

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

  • 5 months later...

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