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
This commit is contained in:
Javen O'Neal 2016-08-24 04:03:26 +00:00
parent 7f7eba3d04
commit cd7b5359f8
1 changed files with 5 additions and 2 deletions

View File

@ -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);