Jump to content
Changes to the Jaspersoft community edition download ×

Dynamic fields colours


jslater

Recommended Posts

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 Green

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

Regards

John

 

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

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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