How to set formulas in cells using Apache POI?

后端 未结 7 1642
慢半拍i
慢半拍i 2021-01-01 09:09

I am currently using Apache POI for Java to set formulas in cells.

But after I run the program and open the Excel file that I created and processed, the cells with t

7条回答
  •  离开以前
    2021-01-01 09:21

    Cell Constants are deprecated and will be removed from version 4.0 instead of Cell Use

    CellType.FORMULA

    String formula= "SUM(B4:B20)";
    cell.setCellType(CellType.FORMULA);
    cell.setCellFormula(formula);
    

提交回复
热议问题