]> source.dussan.org Git - poi.git/commitdiff
Update CreatePivotTable with non-deprecated constructor. This closes #36 on github.
authorJaven O'Neal <onealj@apache.org>
Wed, 24 Aug 2016 03:54:55 +0000 (03:54 +0000)
committerJaven O'Neal <onealj@apache.org>
Wed, 24 Aug 2016 03:54:55 +0000 (03:54 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1757458 13f79535-47bb-0310-9956-ffa450edef68

src/examples/src/org/apache/poi/xssf/usermodel/examples/CreatePivotTable.java

index 518ec37f48498c5922fa79f79d12601dfbcbefd7..6549f482da3c202dcfa3b0f8e8106aeae9f511b6 100644 (file)
@@ -21,6 +21,7 @@ import java.io.FileOutputStream;
 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;
@@ -39,7 +40,8 @@ public class CreatePivotTable {
         //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);
@@ -98,4 +100,4 @@ public class CreatePivotTable {
         Cell cell44 = row4.createCell(3);
         cell44.setCellValue("No");
     }
-}
\ No newline at end of file
+}