From b87fb372690c1ab001667120789b0a444fb58d1b Mon Sep 17 00:00:00 2001 From: Javen O'Neal Date: Wed, 24 Aug 2016 04:03:26 +0000 Subject: [PATCH] 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 --- .../poi/xssf/usermodel/examples/CreatePivotTable.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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); -- 2.39.5