drummer54 Posted April 16, 2014 Share Posted April 16, 2014 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 More sharing options...
sadakar Posted April 21, 2014 Share Posted April 21, 2014 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 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