Package quadbase.reportdesigner.util
Interface ICellScript
- All Superinterfaces:
Serializable
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() invalid input: '<' 0)
cell.setFontColor(java.awt.Color.red);
return cell;
}
}
create an instance of your cell script object and apply it to a cell like so:
ICellScript script = new myScript();
report.getTable().getColumn(1).setCellScript(script);
-
Method Summary
Modifier and TypeMethodDescriptionformatCell(int rowIndex, ReportCell cell, Object originalData, IFormat dataFormat) Format the cell according to the specified parameters
-
Method Details
-
formatCell
ReportCell formatCell(int rowIndex, ReportCell cell, Object originalData, IFormat dataFormat) throws Exception Format the cell according to the specified parameters- Parameters:
rowIndex- the row index of the cellcell- the report cell itself, modify the format of this based on some criteriaoriginalData- original data in contained in the celldataFormat- the format of the data in the cell- Returns:
- the modified cell that will be included in the report
- Throws:
Exception
-