print expression dynamically !

Hi,

I am need to show the status on my report. ie when already my report is printed and the user is printing for second time or more i must show as 'DUPLICATE' on the report.

For this i am having a column in my database where column name as 'STATUS'. The values in the database showup as 'Printed'. But i want to show as Duplicate on the report. I dont have any permissions to update my  database column status values from Printed to DUplicate.

How can i show alias value here for printed as duplicate on the report.

How is this acheived in our Jasper Reports.

rbojja's picture
531
Joined: Oct 3 2007 - 4:11pm
Last seen: 1 year 1 month ago

1 Answer:

You can use a simple text field expression for this:

<field name="StatusColumn"/>

<textField>

  ...

  <textFieldExpression>"Printed".equals($F{StatusColumn}) ? "DUPLICATE" : ""</textFieldExpression>

</textField>

 

HTH,

Lucian

lucianc's picture
86903
Joined: Jul 17 2006 - 1:10am
Last seen: 3 hours 15 min ago
Feedback
randomness