jslater Posted February 17, 2010 Share Posted February 17, 2010 Any help would be much appreciated.My requirement is the following:I have a database field that needs to change colour depending on the string it contains, that is 'Likely Cause' it should display in Red 'Possible Cause' it should display in Amber 'Unlikely Cause' it should display in GreenAs can been seen in the code I have used a conditional style, named 'AlternativeStyle'. This style has then been associated with the 'style' property of the specifc database field.Unfortunately it is not working.Please could someone point out where I am going wrong.Thanks in advance.RegardsJohn Code: <style name="AlternativeStyle" isDefault="false" mode="Opaque"> <conditionalStyle> <conditionExpression><![CDATA[new Boolean ($F{DiagnosticView_Status}.matches("Likely Cause"))]]></conditionExpression> <style isDefault="false" style="AlternativeStyle" mode="Opaque" backcolor="#00FF00"/> </conditionalStyle> <conditionalStyle> <conditionExpression><![CDATA[new Boolean ($F{DiagnosticView_Status}.matches("Possible Cause"))]]></conditionExpression> <style isDefault="false" style="AlternativeStyle" mode="Opaque" backcolor="#FF9900"/> </conditionalStyle> <conditionalStyle> <conditionExpression><![CDATA[new Boolean ($F{DiagnosticView_Status}.matches("Impossible Cause"))]]></conditionExpression> <style isDefault="false" style="AlternativeStyle" mode="Opaque" backcolor="#FF6600"/> </conditionalStyle> </style> 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