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

CalculationMode

Enum Class CalculationMode

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

public enum CalculationMode extends Enum<CalculationMode>
指定导出的工作簿在 Microsoft Excel 中打开时使用的计算模式。

 Workbook workbook = new Workbook();
 workbook.getActiveSheet().getRange("A1").setFormula("SUM(1, 2)");
 workbook.getOptions().getFormulas().setCalculationMode(CalculationMode.Manual);
 workbook.save("path/to/manual-mode.xlsx");
 
  • Enum Constant Details

    • Automatic

      public static final CalculationMode Automatic
      自动重新计算。每当有变更时会自动重新计算,且每次打开工作簿时也会进行计算。
    • Semiautomatic

      public static final CalculationMode Semiautomatic
      半自动重新计算。除数据表和Python公式外,会自动重新计算。
    • Manual

      public static final CalculationMode Manual
      手动计算模式。

      当导出的工作簿在 Microsoft Excel 中打开时,仅当用户显式请求计算时才会重新计算公式。

  • Method Details

    • values

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