[]
为了管理透视表的字段级别,请参考下面的示例代码。
// Product in level 1.
IPivotField field_product = pivottable.getPivotFields().get("Product");
field_product.setOrientation(PivotFieldOrientation.RowField);
// Category in level 2.
IPivotField field_category = pivottable.getPivotFields().get("Category");
field_category.setOrientation(PivotFieldOrientation.RowField);
IPivotField field_Amount = pivottable.getPivotFields().get(3);
field_Amount.setOrientation(PivotFieldOrientation.DataField);
// Category will be in level 1 and product will be in level 2.
field_product.setPosition(1);
field_category.setPosition(0);