Domanda

I have in DB a textfield with HEX color property, for example:

**Name, Color**
John Doe, #FF0000
Albert Smith, #AF0FBA

How can i pass these HEX values through jrxml to render font color properly? Conditional styling didn't match, because i have over 16 millions of colors.

È stato utile?

Soluzione

Add the following property to the text element:

<textField>
  <reportElement ...>
    <propertyExpression name="net.sf.jasperreports.style.forecolor">$F{color}</propertyExpression>
  </reportElement>
  ...
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top