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

SubtotalType

Enum Class SubtotalType

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

public enum SubtotalType extends Enum<SubtotalType>
指定指定数据透视字段的小计类型。

使用此枚举与 IPivotField.setSubtotals(EnumSet) 可以控制非数据数据透视字段显示哪些小计计算。


 worksheet.getRange("A1:B4").setValue(new Object[][] {{"Category", "Amount"}, {"Fruit", 120}, {"Fruit", 80}, {"Drink", 50}});
 IPivotCache pivotCache = workbook.getPivotCaches().create(worksheet.getRange("A1:B4"));
 IPivotTable pivotTable = worksheet.getPivotTables().add(pivotCache, worksheet.getRange("D1"), "SalesPivot");
 pivotTable.getPivotFields().get("Category").setOrientation(PivotFieldOrientation.RowField);
 pivotTable.getPivotFields().get("Category").setSubtotals(EnumSet.of(SubtotalType.Sum, SubtotalType.Count));
 
  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Enum

    Enum.EnumDesc<E extends Enum<E>>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    指定小计类型由数据透视字段的汇总函数自动确定。
    指定小计按数据透视字段中值的平均值计算。
    指定小计按指定数据透视字段中的值数量计算。
    指定包含数值的单元格数量。
    指定小计使用最大值。
    指定小计按数据透视字段中的最小值计算。
    指定不为数据透视字段显示小计。
    指定小计按数据透视字段中值的乘积计算。
    指定小计按指定 PivotField 的样本标准偏差计算。
    指定小计按总体标准偏差计算。
    指定小计按数据透视字段中值的总和计算。
    指定小计按样本方差计算。
    指定小计按总体方差计算。
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the enum constant of this class with the specified name.
    static SubtotalType[]
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • None

      public static final SubtotalType None
      指定不为数据透视字段显示小计。
    • Automatic

      public static final SubtotalType Automatic
      指定小计类型由数据透视字段的汇总函数自动确定。

      使用此值时,小计使用与字段合并设置相同的函数。它与其他小计类型互斥,因此应移除任何其他小计。

    • Sum

      public static final SubtotalType Sum
      指定小计按数据透视字段中值的总和计算。
    • Count

      public static final SubtotalType Count
      指定小计按指定数据透视字段中的值数量计算。
    • Average

      public static final SubtotalType Average
      指定小计按数据透视字段中值的平均值计算。
    • Max

      public static final SubtotalType Max
      指定小计使用最大值。
    • Min

      public static final SubtotalType Min
      指定小计按数据透视字段中的最小值计算。
    • Product

      public static final SubtotalType Product
      指定小计按数据透视字段中值的乘积计算。
    • CountNums

      public static final SubtotalType CountNums
      指定包含数值的单元格数量。
    • StdDev

      public static final SubtotalType StdDev
      指定小计按指定 PivotField 的样本标准偏差计算。
    • StdDevP

      public static final SubtotalType StdDevP
      指定小计按总体标准偏差计算。
    • Var

      public static final SubtotalType Var
      指定小计按样本方差计算。
    • VarP

      public static final SubtotalType VarP
      指定小计按总体方差计算。
  • Method Details

    • values

      public static SubtotalType[] 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 SubtotalType 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