Jump to content
We've recently updated our Privacy Statement, available here ×

Recommended Posts

Can anyone tell me what's wrong with the conditional style code below?

Style definition:
<style name="Style1" mode="Opaque" forecolor="#000000" backcolor="#FFFFFF">
     <conditionalStyle>
          <conditionExpression><![CDATA[$F{description2} == "Percentage Improvement"]]></conditionExpression>
          <style mode="Opaque" forecolor="#000000" backcolor="#DCE6F1"/>
     </conditionalStyle>
     <conditionalStyle>
          <conditionExpression><![CDATA[$F{description2} != "Percentage Improvement"]]></conditionExpression>
          <style mode="Opaque" forecolor="#000000"/>
     </conditionalStyle>
</style>

Text field definition using conditional style defined above:
<textField pattern="">
    <reportElement style="Style1" mode="Opaque" x="444" y="7" width="69" height="48" uuid="14c428e7-5078-41fc-833e-3868937c596d">
         
<printWhenExpression><![CDATA[$F{description2} != "Percentage Improvement"]]></printWhenExpression>
    
</reportElement>
    <textElement textAlignment="Center" verticalAlignment="Bottom" markup="html">
         <font fontName="Arial" size="9" isBold="true"/>
    </textElement>
    <textFieldExpression><![CDATA[$F{description2} + "<br>Individual Requirements"]]></textFieldExpression>
</textField>

No matter what the value of $F{description2} the background color is white.

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Make use of ternari condition. See the dashboard example for conditional coloring code if you use professional server.

If you don't use it, connect to demo server and see the dashboard reports to find out confitional coloring to the text or back groud color for the text. Hope this will helpful.

 

Link to comment
Share on other sites

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