Use conditional HTML Expression for formatting.
Please follow the below step to change font fore color with HTML Expression.
Step 1 : Set Text field below property
Markup = "html"
Step 2 : Right click on Field to edit and write below expression. [Language:Groovy]
Here we are using the groovy language if condition.
If field value is "UNBEARABLE" then print the value with color red else green.
<strong>$F{field_name}.trim() == "UNBEARABLE" ? "<font color=red>" + $F{field_name} + "</font>" : "<font color=green>" + $F{field_name} + "</font>"</strong>
Below is the output / result.
tags:
Jasper Report
Jasper Server
iReport
Date Formats
Thank you ! Nice post.
ReplyDeletePerfect ! small and sweet explanation.
ReplyDeleteThat I looking for.
Thank you very much for post on blog.
Thats i am looking for.
ReplyDeleteRegards,
Amit