[]
Serializable, Comparable<PivotCellType>, Constable由 IPivotCell.getPivotCellType() 使用,用于标识单元格在数据透视表报表中属于哪种区域,例如数据值、数据透视项标签、小计或总计。
Object sourceData = new Object[][] {
{"Order ID", "Product", "Category", "Amount"},
{1, "Widget", "Gadgets", 100},
{2, "Gizmo", "Gadgets", 200},
{3, "Doohickey", "Tools", 150},
};
worksheet.getRange("G1:J4").setValue(sourceData);
IPivotCache pivotCache = workbook.getPivotCaches().create(worksheet.getRange("G1:J4"));
IPivotTable pivotTable = worksheet.getPivotTables().add(pivotCache, worksheet.getRange("A1"), "pt1");
pivotTable.getPivotFields().get("Category").setOrientation(PivotFieldOrientation.RowField);
pivotTable.getPivotFields().get("Amount").setOrientation(PivotFieldOrientation.DataField);
IPivotLine line = pivotTable.getPivotRowAxis().getPivotLines().get(0);
IPivotCell pivotCell = line.getPivotLineCells().get(0);
PivotCellType cellType = pivotCell.getPivotCellType();
Enum.EnumDesc<E extends Enum<E>>static PivotCellTypestatic PivotCellType[]values()name - the name of the enum constant to be returned.IllegalArgumentException - if this enum class has no constant with the specified nameNullPointerException - if the argument is null