Namespace EasyXLS

Class ExcelOptions


  • public class ExcelOptions
    extends System.Object
    This class stores some of the options of an Excel document, available in the main menu Tools/Options window.
    • Constructor Summary

      Constructors 
      Constructor Description
      ExcelOptions()
      Defines an instance of the ExcelOption class.
    • Method Summary

      Modifier and Type Method Description
      bool CalculateFormulas()
      Returns the flag that stores if the formulas are calculated when the document is saved.
      ExcelOptions Clone()
      Creates and returns a copy of this object.
      const bool DisplayErrors()
      Returns the flag that stores if the errors or the warnings are displayed on the console.
      int getEncryptionType()
      Returns the encryption type.
      double getMaximumChange()
      Returns the upper bound for values when the circular references are calculated.
      int getMaximumIterations()
      Returns the maximum number of iterations when the circular references are calculated.
      System.String getPasswordToModify()
      Returns the password required for modifying the document.
      System.String getPasswordToOpen()
      Returns the password required for opening the document.
      bool IsIterativeCalculation()
      Returns true if the iterative calculation is enabled, false otherwise.
      bool IsR1C1ReferenceStyle()
      Returns the R1C1 reference style of the document.
      void setCalculateFormulas​(bool calculateFormulas)
      Sets the flag that stores if the formulas are calculated when the document is saved.
      const void setDisplayErrors​(bool displayErrors)
      Sets the flag that stores if the errors or the warnings are displayed on the console.
      void setEncryptionOptions​(int encryptionType, System.String passwordToOpen)
      Sets the encryption options when a file is written and the document is encrypted.
      void setIterativeCalculation​(bool enable, int maximumIterations, double maximumChange)
      Sets the iterative calculation option for circular references.
      void setPasswordToModify​(System.String passwordToModify)
      Sets the password required for modifying the document.
      void setPasswordToOpen​(System.String passwordToOpen)
      Sets the password required for opening the document.
      void setR1C1ReferenceStyle​(bool isR1C1ReferenceStyle)
      Sets the R1C1 reference style of the document.
    • Constructor Detail

      • ExcelOptions

        public ExcelOptions()
        Defines an instance of the ExcelOption class.
    • Method Detail

      • CalculateFormulas

        public bool CalculateFormulas()
        Returns the flag that stores if the formulas are calculated when the document is saved.
        Returns:
        true if the formulas are calculated when the document is saved, false otherwise
        See Also:
        setCalculateFormulas(bool)
      • setCalculateFormulas

        public void setCalculateFormulas​(bool calculateFormulas)
        Sets the flag that stores if the formulas are calculated when the document is saved.
        Parameters:
        calculateFormulas - true if the formulas are calculated when the document is saved, false otherwise
        See Also:
        CalculateFormulas()
      • setIterativeCalculation

        public void setIterativeCalculation​(bool enable,
                                            int maximumIterations,
                                            double maximumChange)
        Sets the iterative calculation option for circular references.
        Parameters:
        enable - true if the iterative calculation is enabled for circular references
        maximumIterations - the maximum number of iterations when the circular references are calculated
        maximumChange - the upper bound for values when the circular references are calculated
        See Also:
        IsIterativeCalculation(), getMaximumIterations(), getMaximumChange()
      • IsR1C1ReferenceStyle

        public bool IsR1C1ReferenceStyle()
        Returns the R1C1 reference style of the document.
        Returns:
        the R1C1 reference style of the document
        See Also:
        setR1C1ReferenceStyle(bool)
      • setR1C1ReferenceStyle

        public void setR1C1ReferenceStyle​(bool isR1C1ReferenceStyle)
        Sets the R1C1 reference style of the document.
        Parameters:
        isR1C1ReferenceStyle - the R1C1 reference style of the document
        See Also:
        IsR1C1ReferenceStyle()
      • DisplayErrors

        public const bool DisplayErrors()
        Returns the flag that stores if the errors or the warnings are displayed on the console.
        Returns:
        true if the errors or the warnings are displayed on the console, false otherwise
        See Also:
        setDisplayErrors(bool)
      • setDisplayErrors

        public const void setDisplayErrors​(bool displayErrors)
        Sets the flag that stores if the errors or the warnings are displayed on the console.
        Parameters:
        displayErrors - true if the errors or the warnings are displayed on the console, false otherwise
        See Also:
        DisplayErrors()
      • setEncryptionOptions

        public void setEncryptionOptions​(int encryptionType,
                                         System.String passwordToOpen)
        Sets the encryption options when a file is written and the document is encrypted.
        Parameters:
        encryptionType - the encryption type. Possible values are available in Encrypt class.
        passwordToOpen - the password required for opening the document
      • getEncryptionType

        public int getEncryptionType()
        Returns the encryption type. Possible values are available in Encrypt class.
        Returns:
        the encryption type
      • setPasswordToOpen

        public void setPasswordToOpen​(System.String passwordToOpen)
        Sets the password required for opening the document. If a password is set, the document is encrypted.
        Parameters:
        passwordToOpen - the password required for opening the document
      • getPasswordToOpen

        public System.String getPasswordToOpen()
        Returns the password required for opening the document.
        Returns:
        the password required for opening the document
      • setPasswordToModify

        public void setPasswordToModify​(System.String passwordToModify)
        Sets the password required for modifying the document.
        Parameters:
        passwordToModify - the password required for modifying the document
      • getPasswordToModify

        public System.String getPasswordToModify()
        Returns the password required for modifying the document.
        Returns:
        the password required for modifying the document
      • Clone

        public ExcelOptions Clone()
        Creates and returns a copy of this object.
        Returns:
        a clone of this instance.