Pages

Friday, August 26, 2011

Show negative values in different format - Jasper - ireport

This is a sample to show negative values in different colour.


1.First duplicate the variable field by coping and paste cell
2.Write following expression in the "print when expression" area in property window.
              $V{Variances}.doubleValue()<0
3.Change the forecolor property in property window into Red
4.Change original cell's "print when expression" as follows
              $V{Variances}.doubleValue()>0
5. Position both original and duplicated cell in same position.
6. save and run the report. It will print the negative values in red colour and positive values in black colour as we defined in "Print when expression"

1 comment: