EAS分录操作
1、删除分录
this.kdtOtherEntrys.removeRows();
2、新增行
this.kdtOtherEntrys.addRow();
3、给单元格写数据
**this**.kdtOtherEntrys.getCell(0, "fa").setValue(prmtfa.getData());
4、锁定行
kdtAssEntrys.getRow(0).getStyleAttributes().setLocked(true);
5、设置字体
kdtAssEntrys.getRow(0).getStyleAttributes().setItalic(true);
6、显示合计行
点击查看代码
@Override
protected void setTableToSumField() {
super.setTableToSumField();
setTableToSumField(kdtEntrys, new String[] {"amtLease","amtDepreciation","amtInterest","amtPrincipal"});
}
7、列表显示格式
table.getColumn(colIndex).getStyleAttributes().setNumberFormat(formatString); //设置某列显示格式
table.getCell(rowIndex, colIndex).getStyleAttributes().setNumberFormat(formatString); //设置某单元格显示格式
//1.数值类
table.getColumn(colIndex).getStyleAttributes().setNumberFormat("0.00");//0.00 表示显示两位小数,末尾为0时0仍显示
table.getColumn(colIndex).getStyleAttributes().setNumberFormat("0.##");//0.## 表示显示两位小数,末尾为0时0不显示
table.getColumn(colIndex).getStyleAttributes().setNumberFormat("#,##0.00");//#,##0.00 表示显示两位小数,且显示千分位
//2.日期类
table.getColumn(colIndex).getStyleAttributes().setNumberFormat("yyyy-m-d");
table.getColumn(colIndex).getStyleAttributes().setNumberFormat("yyyy-MM-dd");
table.getColumn(colIndex).getStyleAttributes().setNumberFormat("yyyy-MM-dd HH:mm:ss");
table.getColumn(colIndex).getStyleAttributes().setNumberFormat("yyyy年MM月dd日");
//3.百分比
table.getColumn(colIndex).getStyleAttributes().setNumberFormat("0%");