[]
Serializable, Comparable<LayoutFormType>, Constable将此枚举与 IPivotField.setLayoutForm(LayoutFormType) 一起使用,可按表格形式或大纲形式显示项。Tabular 以表格形式显示字段,Outline 以大纲形式显示字段。
worksheet.getRange("A1:C4").setValue(new Object[][] {
{"Category", "Product", "Amount"},
{"Fruit", "Apple", 100},
{"Fruit", "Orange", 200},
{"Vegetable", "Carrot", 150}
});
IPivotCache pivotCache = workbook.getPivotCaches().create(worksheet.getRange("A1:C4"));
IPivotTable pivotTable = worksheet.getPivotTables().add(pivotCache, worksheet.getRange("E1"));
IPivotField field = pivotTable.getPivotFields().get("Category");
field.setOrientation(PivotFieldOrientation.RowField);
field.setLayoutForm(LayoutFormType.Outline);
Enum.EnumDesc<E extends Enum<E>>static LayoutFormTypeforValue(int value) intgetValue()static LayoutFormTypestatic LayoutFormType[]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