答案 0 :(得分:0)
合并单元格:
CellRangeAddress address = new CellRangeAddress(firstRow, lastRow, firstColumn, lastColumn);
sheet.addMergedRegion(address);
请注意,索引从零开始
添加公式:
String formula= "SUM(A1:A20)";
cell.setCellType(CellType.FORMULA);
cell.setCellFormula(formula);