[]
        
(Showing Draft Content)

SjsOpenOptions

Class SjsOpenOptions

java.lang.Object
com.grapecity.documents.excel.OpenOptionsBase
com.grapecity.documents.excel.SjsOpenOptions

public class SjsOpenOptions extends OpenOptionsBase
Represents options for opening a SpreadJS .sjs file.

Use this class with Workbook.open(String,OpenOptionsBase) or related APIs when loading an .sjs file. A new SjsOpenOptions instance sets the file format to OpenFileFormat.Sjs. By default, styles and formulas are included when the file is loaded.


 SjsOpenOptions openOptions = new SjsOpenOptions();
 openOptions.setIncludeStyles(false);
 openOptions.setIncludeFormulas(true);
 workbook.open("path/to/file.sjs", openOptions);
 
  • Constructor Details

    • SjsOpenOptions

      public SjsOpenOptions()
      Creates a new set of options for opening SpreadJS .sjs content.

      A new instance sets the file format to OpenFileFormat.Sjs. Styles and formulas are included when loading unless you change them with setIncludeStyles(boolean) or setIncludeFormulas(boolean).

      
       SjsOpenOptions openOptions = new SjsOpenOptions();
       openOptions.setIncludeStyles(false);
       workbook.open("path/to/file.sjs", openOptions);
       
  • Method Details

    • getIncludeStyles

      public final boolean getIncludeStyles()
      Gets whether styles are included when loading a SpreadJS `.sjs` file.

      This option controls whether style information in the `.sjs` file is loaded. The default value is true.

      
       SjsOpenOptions openOptions = new SjsOpenOptions();
       openOptions.setIncludeStyles(false);
       boolean includeStyles = openOptions.getIncludeStyles();
       workbook.open("path/to/file.sjs", openOptions);
       
      Returns:
      true if styles are included when loading a `.sjs` file; otherwise, false.
    • setIncludeStyles

      public final void setIncludeStyles(boolean value)
      Sets whether styles are included when loading a SpreadJS `.sjs` file.

      This option controls whether style information in the `.sjs` file is loaded. The default value is true.

      
       SjsOpenOptions openOptions = new SjsOpenOptions();
       openOptions.setIncludeStyles(false);
       workbook.open("path/to/file.sjs", openOptions);
       
      Parameters:
      value - true if styles are included when loading a `.sjs` file; otherwise, false.
    • getIncludeFormulas

      public final boolean getIncludeFormulas()
      Gets whether formulas are included when loading a SpreadJS .sjs file.

      This option indicates whether formula information in the .sjs file is loaded. The default value is true.

      
       SjsOpenOptions openOptions = new SjsOpenOptions();
       openOptions.setIncludeFormulas(false);
       boolean includeFormulas = openOptions.getIncludeFormulas();
       workbook.open("path/to/file.sjs", openOptions);
       
      Returns:
      true if formulas are included when loading a .sjs file; otherwise, false.
    • setIncludeFormulas

      public final void setIncludeFormulas(boolean value)
      Sets whether formulas are included when loading a SpreadJS .sjs file.

      This option indicates whether formula information in the .sjs file is loaded. The default value is true.

      
       SjsOpenOptions openOptions = new SjsOpenOptions();
       openOptions.setIncludeFormulas(false);
       workbook.open("path/to/file.sjs", openOptions);
       
      Parameters:
      value - true if formulas are included when loading a .sjs file; otherwise, false.
    • getInvalidFormulaHandling

      public final InvalidFormulaHandling getInvalidFormulaHandling()
      Gets how invalid formulas are handled when opening a SpreadJS .sjs file. The default value is InvalidFormulaHandling.Discard.
      
       SjsOpenOptions openOptions = new SjsOpenOptions();
       openOptions.setInvalidFormulaHandling(InvalidFormulaHandling.Preserve);
       InvalidFormulaHandling invalidFormulaHandling = openOptions.getInvalidFormulaHandling();
       
      Returns:
      How invalid formulas are handled when opening a SpreadJS .sjs file.
    • setInvalidFormulaHandling

      public final void setInvalidFormulaHandling(InvalidFormulaHandling value)
      Sets how invalid formulas are handled when opening a SpreadJS .sjs file. The default value is InvalidFormulaHandling.Discard.
      
       SjsOpenOptions openOptions = new SjsOpenOptions();
       openOptions.setInvalidFormulaHandling(InvalidFormulaHandling.Preserve);
       
      Parameters:
      value - How invalid formulas are handled when opening a SpreadJS .sjs file.