[]
Use this class to control which workbook content is included when exporting to `.sjs`, such as styles, formulas, unused names, empty cells outside the used range, binding sources, automatically merged cells, and data outside the defined row and column counts. By default, styles, formulas, unused names, empty region cells, and binding sources are included, while automatically merged cells are not included and data outside RowCount and ColumnCount is not ignored.
This class can be used with Workbook.save(String,SaveOptionsBase) to write an`.sjs` file, or with Workbook.toSjsJson(SjsSaveOptions) to generate a single JSON string from the `.sjs` content.
worksheet.getRange("A1").setValue("Name");
SjsSaveOptions options = new SjsSaveOptions();
options.setIncludeStyles(false);
String json = workbook.toSjsJson(options);
workbook.save("path/to/output.sjs", options);
.sjs content.booleanRowCount and ColumnCount is ignored when exporting to an .sjs file.booleanfinal booleanfinal booleanfinal booleanfinal booleanfinal booleanvoidsetIgnoreRangeOutOfRowColumnCount(boolean value) RowCount and ColumnCount is ignored when exporting to an .sjs file.voidsetIncludeAutoMergedCells(boolean value) final voidsetIncludeBindingSource(boolean value) final voidsetIncludeEmptyRegionCells(boolean value) final voidsetIncludeFormulas(boolean value) final voidsetIncludeStyles(boolean value) final voidsetIncludeUnusedNames(boolean value) getFileFormat, setFileFormat.sjs content.This constructor configures the file format to SaveFileFormat.Sjs.
SjsSaveOptions options = new SjsSaveOptions();
workbook.save("path/to/output.sjs", options);
This option controls whether style information is written when exporting to the SpreadJS .sjs format. By default, the value is true.
SjsSaveOptions options = new SjsSaveOptions();
options.setIncludeStyles(false);
boolean includeStyles = options.getIncludeStyles();
workbook.save("path/to/output.sjs", options);
true if styles are included when saving files; otherwise, false.This option controls whether style information is written when exporting to the SpreadJS .sjs format. By default, the value is true.
SjsSaveOptions options = new SjsSaveOptions();
options.setIncludeStyles(false);
workbook.save("path/to/output.sjs", options);
value - true if styles are included when saving files; otherwise, false.The default value is true.
SjsSaveOptions options = new SjsSaveOptions();
options.setIncludeFormulas(false);
boolean includeFormulas = options.getIncludeFormulas();
workbook.save("path/to/output.sjs", options);
true if formulas are included when saving the file; otherwise, false.The default value is true.
SjsSaveOptions options = new SjsSaveOptions();
options.setIncludeFormulas(false);
workbook.save("path/to/output.sjs", options);
value - true if formulas are included when saving the file; otherwise, false.This property applies to SjsSaveOptions when exporting to the SpreadJS.sjs format. If this property is true, unused custom names are included in the saved file. By default, the value is true.
SjsSaveOptions options = new SjsSaveOptions();
options.setIncludeUnusedNames(false);
boolean includeUnusedNames = options.getIncludeUnusedNames();
workbook.save("path/to/output.sjs", options);
true if unused custom names are included when saving the file; otherwise, false.This property applies to SjsSaveOptions when exporting to the SpreadJS.sjs format. If this property is true, unused custom names are included in the saved file. By default, the value is true.
SjsSaveOptions options = new SjsSaveOptions();
options.setIncludeUnusedNames(false);
workbook.save("path/to/output.sjs", options);
value - true if unused custom names are included when saving the file; otherwise, false.The default value is true.
SjsSaveOptions options = new SjsSaveOptions();
options.setIncludeEmptyRegionCells(false);
boolean includeEmptyRegionCells = options.getIncludeEmptyRegionCells();
workbook.save("path/to/output.sjs", options);
true if empty cells outside the used data range are included during SJS export; otherwise, false.The default value is true.
SjsSaveOptions options = new SjsSaveOptions();
options.setIncludeEmptyRegionCells(false);
workbook.save("path/to/output.sjs", options);
value - true if empty cells outside the used data range are included during SJS export; otherwise, false.RowCount and ColumnCount is ignored when exporting to an .sjs file.The default value is false. When this property is false, data outside the specified row and column count is still exported to the .sjs file.
SjsSaveOptions options = new SjsSaveOptions();
options.setIgnoreRangeOutOfRowColumnCount(true);
boolean ignore = options.getIgnoreRangeOutOfRowColumnCount();
workbook.save("path/to/output.sjs", options);
true if data outside the worksheet row and column count is ignored during .sjs export; otherwise, false.RowCount and ColumnCount is ignored when exporting to an .sjs file.The default value is false. When this property is false, data outside the specified row and column count is still exported to the .sjs file.
SjsSaveOptions options = new SjsSaveOptions();
options.setIgnoreRangeOutOfRowColumnCount(true);
workbook.save("path/to/output.sjs", options);
value - true if data outside the worksheet row and column count is ignored during .sjs export; otherwise, false.This option controls whether bound data is exported when the workbook is saved to SpreadJS .sjs format. The default value is true.
SjsSaveOptions options = new SjsSaveOptions();
options.setIncludeBindingSource(false);
boolean includeBindingSource = options.getIncludeBindingSource();
workbook.save("path/to/output.sjs", options);
true if the binding source is included when saving the file; otherwise, false.This option controls whether bound data is exported when the workbook is saved to SpreadJS .sjs format. The default value is true.
SjsSaveOptions options = new SjsSaveOptions();
options.setIncludeBindingSource(false);
workbook.save("path/to/output.sjs", options);
value - true if the binding source is included when saving the file; otherwise, false.The default value is false.
SjsSaveOptions options = new SjsSaveOptions();
options.setIncludeAutoMergedCells(true);
boolean includeAutoMergedCells = options.getIncludeAutoMergedCells();
workbook.save("path/to/output.sjs", options);
true if automatically merged cells are included; otherwise, false.The default value is false.
SjsSaveOptions options = new SjsSaveOptions();
options.setIncludeAutoMergedCells(true);
workbook.save("path/to/output.sjs", options);
value - true if automatically merged cells are included; otherwise, false.