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

gujralam

Members
  • Posts

    2
  • Joined

  • Last visited

gujralam's Achievements

Newbie

Newbie (1/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare
  • Conversation Starter Rare

Recent Badges

0

Reputation

  1. Hi Axel, Thank you for the suggestion and I apologise for the late response. I tried the following and it worked nicely on excel and now I am able to change the colors 1. In the textelement put masrkup as styled and then 2. Add <style forecolor=\"black\"> </style> in the CDATA section Please see below for details. Once again appreciate your suggestion. Any pointers to a nice tutorial on your suggestion would be welcomed. Regards Amit Code: <textElement markup="styled"> <font size="8"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[($F{DISPLAYFLAG}.equals("F")?"<style forecolor=\"darkGray\">NOT TO BE RUN FOR THE DAY</style>":($F{JOBSTATUS}.equals("I")?"<style forecolor=\"black\">COMPLETED</style>":($F{JOBSTATUS}.equals("X")?"<style isBold=\"true\" forecolor=\"blue\">CANCELLED</style>":($F{JOBSTATUS}.equals("R")?"<style isBold=\"true\" forecolor=\"yellow\">RUNNING</style>":($F{JOBSTATUS}.equals("F")?"<style isBold=\"true\" forecolor=\"red\">FAILED<style>":($F{JOBSTATUS}.equals("C")?"<style forecolor=\"black\">COMPLETED</STYLE>":"N.A."))))))]]></textFieldExpression>
  2. Hi All, I am new to Jasper and I need your assistance for resolving a problem. I am creating a Excel file using Jasper Reports. I have a requirement by which I need to change the FONT color based on value of a field. E.g. In the TextExpression below, if the value of the the field, JOBSTATUS, is 'Completed' the text (Completed) should be displayed in GREEN, But if the value of the field, JOBSTATUS, is 'Failed', the text (Failed) should be displayed in RED, <textFieldExpression class="java.lang.String"><![CDATA[($F{DISPLAYFLAG}.equals("F")?"NOT TO BE RUN FOR THE DAY":($F{JOBSTATUS}.equals("I")?"COMPLETED":($F{JOBSTATUS}.equals("X")?"CANCELLED":($F{JOBSTATUS}.equals("R")?"RUNNING":($F{JOBSTATUS}.equals("F")?"FAILED":($F{JOBSTATUS}.equals("C")?"COMPLETED":"N.A."))))))]]></textFieldExpression> Please can you guide me how to go about designing my JRXML in this case. I donot want to make any changes in the JAVA. Thanks in advance for your help !! Code:<textFieldExpression class="java.lang.String"><![CDATA[($F{DISPLAYFLAG}.equals("F")?"NOT TO BE RUN FOR THE DAY":($F{JOBSTATUS}.equals("I")?"COMPLETED":($F{JOBSTATUS}.equals("X")?"CANCELLED":($F{JOBSTATUS}.equals("R")?"RUNNING":($F{JOBSTATUS}.equals("F")?"FAILED":($F{JOBSTATUS}.equals("C")?"COMPLETED":"N.A."))))))]]></textFieldExpression>
×
×
  • Create New...