[]
        
首页
开发者学堂
文档
论坛
市场
生态机会
活动
立即试用
(Showing Draft Content)

SubtotalLocationType

Enum Class SubtotalLocationType

java.lang.Object
java.lang.Enum<SubtotalLocationType>
com.grapecity.documents.excel.SubtotalLocationType
All Implemented Interfaces:
Serializable, Comparable<SubtotalLocationType>, Constable

public enum SubtotalLocationType extends Enum<SubtotalLocationType>
指定数据透视表报表中小计的显示位置。

使用 Top 可将小计放置在相关字段项上方,使用 Bottom 可将小计放置在相关字段项下方。与 IPivotTable.subtotalLocation(SubtotalLocationType) 一起使用时,如果需要 Bottom,则数据透视表行布局必须为 LayoutRowType.TabularRow。


 worksheet.getRange("A1:B5").setValue(new Object[][] {
     {"Product", "Amount"},
     {"A", 100},
     {"A", 200},
     {"B", 300},
     {"B", 400}
 });
 IPivotCache pivotCache = workbook.getPivotCaches().create(worksheet.getRange("A1:B5"));
 IPivotTable pivotTable = worksheet.getPivotTables().add(pivotCache, worksheet.getRange("D1"), "PivotTable1");
 pivotTable.getPivotFields().get("Product").setOrientation(PivotFieldOrientation.RowField);
 pivotTable.subtotalLocation(SubtotalLocationType.Top);
 
  • Enum Constant Details

    • Top

      public static final SubtotalLocationType Top
      指定小计显示在关联的明细行上方。
    • Bottom

      public static final SubtotalLocationType Bottom
      指定小计显示在相关数据透视表字段项下方。
  • Method Details

    • values

      public static SubtotalLocationType[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static SubtotalLocationType valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null