[]
        
(Showing Draft Content)

TotalsCalculation

Enum Class TotalsCalculation

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

public enum TotalsCalculation extends Enum<TotalsCalculation>
Specifies the type of calculation in the totals row of a table column.

Use this enumeration with ITableColumn.setTotalsCalculation(TotalsCalculation) to control how the totals cell is calculated for a table column, such as summing numeric values, counting cells, or returning the minimum or maximum value.


 worksheet.getRange("A1:B3").setValue(new Object[][] {
     {"Product", "Amount"},
     {"Apple", 100},
     {"Pear", 200}
 });
 ITable table = worksheet.getTables().add(worksheet.getRange("A1:B3"), true);
 table.setShowTotals(true);
 table.getColumns().get(1).setTotalsCalculation(TotalsCalculation.Sum);
 
  • Enum Constant Details

  • Method Details

    • values

      public static TotalsCalculation[] 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 TotalsCalculation 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
    • getValue

      public int getValue()
      Gets the numeric value of this enum member.
      Returns:
      The zero-based numeric value of this enum member.
    • forValue

      public static TotalsCalculation forValue(int value)
      Gets the enum member that corresponds to the specified numeric value.
      Parameters:
      value - The zero-based numeric value.
      Returns:
      The corresponding enum member.