Total Pageviews

2019/09/14

[Apache POI] How to set formula in Excel via Apache POI?

Problem
How to set formula in Excel via Apache POI?

How-To
Sample code:
    // 1. create sheet from workbook
    Sheet sheet= workbook.createSheet("Goal");

    // 2. create row
    Row row = sheet.createRow(rowCount++);

    // 3. create cell and set formula
    row.createCell(13).setCellFormula("SUM(B8:M8)");


No comments: