[]
Serializable, Comparable<PivotFieldRepeatLabels>, Constable将此枚举与 IPivotTable.repeatAllLabels(PivotFieldRepeatLabels)一起使用,可以控制是否在每一行显示重复的行字段项,或仅显示一次。
worksheet.getRange("A1:C5").setValue(new Object[][] {
{"Category", "Product", "Amount"},
{"Beverages", "Tea", 100},
{"Beverages", "Coffee", 200},
{"Snacks", "Chips", 150},
{"Snacks", "Nuts", 120}
});
IPivotCache pivotCache = workbook.getPivotCaches().create(worksheet.getRange("A1:C5"));
IPivotTable pivotTable = worksheet.getPivotTables().add(pivotCache, worksheet.getRange("E1"), "SalesPivot");
pivotTable.repeatAllLabels(PivotFieldRepeatLabels.RepeatLabels);
Enum.EnumDesc<E extends Enum<E>>static PivotFieldRepeatLabelsstatic PivotFieldRepeatLabels[]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