[]
Serializable, Comparable<PivotLineType>, Constable将此枚举与 IPivotLine.getLineType() 一起使用,可以确定数据透视线是常规项数据透视线、小计数据透视线、总计数据透视线还是空白分隔数据透视线。
worksheet.getRange("A1:B4").setValue(new Object[][] {
{"Category", "Amount"},
{"Fruit", 100},
{"Fruit", 200},
{"Vegetable", 50}
});
IPivotCache pivotCache = workbook.getPivotCaches().create(worksheet.getRange("A1:B4"));
IWorksheet pivotSheet = workbook.getWorksheets().add();
IPivotTable pivotTable = pivotSheet.getPivotTables().add(pivotCache, pivotSheet.getRange("A1"), "SalesPivot");
pivotTable.getPivotFields().get("Category").setOrientation(PivotFieldOrientation.RowField);
pivotTable.getPivotFields().get("Amount").setOrientation(PivotFieldOrientation.DataField);
pivotTable.update();
IPivotLine line = pivotTable.getPivotRowAxis().getPivotLines().get(0);
if (line.getLineType() == PivotLineType.Regular) {
IPivotLineCells cells = line.getPivotLineCells();
}
Enum.EnumDesc<E extends Enum<E>>static PivotLineTypestatic PivotLineType[]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