EspressReport 6.6

Interface ICellScript

All Superinterfaces:

public interface ICellScript

Extend this class to create a new cell script for a report, then add an instance of your class to a particular cell of your report table to apply the script. For example, write a class called myScript:

public class myScript implements ICellScript {

    // makes the font color of the cell RED if the data is less than 0

    public ReportCell formatCell(int rowIndex, ReportCell cell, Object originalData,

      IFormat dataFormat) throws Exception
      if (originalData instanceof Double)
        if (((Double)originalData).intValue() < 0)
      return cell;

create an instance of your cell script object and apply it to a cell like so:

ICellScript script = new myScript();

Method Summary
 ReportCell formatCell(int rowIndex, ReportCell cell, java.lang.Object originalData, IFormat dataFormat)
          Format the cell according to the specified parameters

Method Detail


ReportCell formatCell(int rowIndex,
                      ReportCell cell,
                      java.lang.Object originalData,
                      IFormat dataFormat)
                      throws java.lang.Exception
Format the cell according to the specified parameters

rowIndex - the row index of the cell
cell - the report cell itself, modify the format of this based on some criteria
originalData - original data in contained in the cell
dataFormat - the format of the data in the cell
the modified cell that will be included in the report

EspressReport 6.6