[]
Serializable, Comparable<PivotFieldOrientation>, Constable将此枚举与 IPivotField.setOrientation(PivotFieldOrientation)一起使用,可以将数据透视字段放置在行区域、列区域、页区域、数据区域,或隐藏该字段。
Object[][] sourceData = {
{"Product", "Region", "Amount"},
{"Apple", "East", 120},
{"Apple", "West", 80},
{"Orange", "East", 90}
};
worksheet.getRange("A1:C4").setValue(sourceData);
IPivotCache pivotCache = workbook.getPivotCaches().create(worksheet.getRange("A1:C4"));
IPivotTable pivotTable = worksheet.getPivotTables().add(pivotCache, worksheet.getRange("E1"), "SalesPivot");
pivotTable.getPivotFields().get("Region").setOrientation(PivotFieldOrientation.RowField);
Enum.EnumDesc<E extends Enum<E>>static PivotFieldOrientationstatic PivotFieldOrientation[]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