import java.io.IOException;
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
+import org.apache.poi.ss.SpreadsheetVersion;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.DataConsolidateFunction;
import org.apache.poi.ss.usermodel.Row;
//Create some data to build the pivot table on
setCellData(sheet);
- XSSFPivotTable pivotTable = sheet.createPivotTable(new AreaReference("A1:D4"), new CellReference("H5"));
+ AreaReference area = new AreaReference("A1:D4", SpreadsheetVersion.EXCEL2007);
+ XSSFPivotTable pivotTable = sheet.createPivotTable(area, new CellReference("H5"));
//Configure the pivot table
//Use first column as row label
pivotTable.addRowLabel(0);
Cell cell44 = row4.createCell(3);
cell44.setCellValue("No");
}
-}
\ No newline at end of file
+}