wmq1310

1、删除分录

this.kdtOtherEntrys.removeRows();

2、新增行

this.kdtOtherEntrys.addRow(); 
this.kdtEntrys.getCell(0, "period").setValue("期初");
this.kdtEntrys.getCell(0, "periodNum").setValue(0);

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); //设置某单元格显示格式

####//0.设置分录样式
this.kdtEntrys.getRow(0).getStyleAttributes().setBackground(new Color(167,167,167));

####//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%");

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-03
  • 2022-12-23
  • 2021-08-21
  • 2022-12-23
  • 2021-06-29
猜你喜欢
  • 2022-12-23
  • 2022-01-05
  • 2021-05-26
  • 2022-12-23
  • 2021-12-17
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案