From: Javen O'Neal Date: Wed, 24 Aug 2016 04:03:26 +0000 (+0000) Subject: make CreatePivotTable self-explaining with better variable names X-Git-Tag: REL_3_15_FINAL~2^2~10 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=b87fb372690c1ab001667120789b0a444fb58d1b;p=poi.git make CreatePivotTable self-explaining with better variable names git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1757459 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/examples/src/org/apache/poi/xssf/usermodel/examples/CreatePivotTable.java b/src/examples/src/org/apache/poi/xssf/usermodel/examples/CreatePivotTable.java index 6549f482da..a855feedae 100644 --- a/src/examples/src/org/apache/poi/xssf/usermodel/examples/CreatePivotTable.java +++ b/src/examples/src/org/apache/poi/xssf/usermodel/examples/CreatePivotTable.java @@ -40,8 +40,11 @@ public class CreatePivotTable { //Create some data to build the pivot table on setCellData(sheet); - AreaReference area = new AreaReference("A1:D4", SpreadsheetVersion.EXCEL2007); - XSSFPivotTable pivotTable = sheet.createPivotTable(area, new CellReference("H5")); + AreaReference source = new AreaReference("A1:D4", SpreadsheetVersion.EXCEL2007); + CellReference position = new CellReference("H5"); + // Create a pivot table on this sheet, with H5 as the top-left cell.. + // The pivot table's data source is on the same sheet in A1:D4 + XSSFPivotTable pivotTable = sheet.createPivotTable(source, position); //Configure the pivot table //Use first column as row label pivotTable.addRowLabel(0);