[]
Serializable, Comparable<SubtotalType>, Constable使用此枚举与 IPivotField.setSubtotals(EnumSet) 可以控制非数据数据透视字段显示哪些小计计算。
worksheet.getRange("A1:B4").setValue(new Object[][] {{"Category", "Amount"}, {"Fruit", 120}, {"Fruit", 80}, {"Drink", 50}});
IPivotCache pivotCache = workbook.getPivotCaches().create(worksheet.getRange("A1:B4"));
IPivotTable pivotTable = worksheet.getPivotTables().add(pivotCache, worksheet.getRange("D1"), "SalesPivot");
pivotTable.getPivotFields().get("Category").setOrientation(PivotFieldOrientation.RowField);
pivotTable.getPivotFields().get("Category").setSubtotals(EnumSet.of(SubtotalType.Sum, SubtotalType.Count));
Enum.EnumDesc<E extends Enum<E>>static SubtotalTypestatic SubtotalType[]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