This parameterless constructor creates a new instance of SpreadsheetSaveOptions with XLSX output format (can be modified then through OutputFormat (#getOutputFormat.getOutputFormat/#setOutputFormat(SpreadsheetFormats).setOutputFormat(SpreadsheetFormats)) property)
Allows to specify, modify, obtain, or remove a password, which will be used to encode the generated Spreadsheet document, if tis document format supports password protection.
Allows to specify, modify, obtain, or remove a password, which will be used to encode the generated Spreadsheet document, if tis document format supports password protection.
Boolean flag, which specifies whether edited worksheet should replace the existing worksheet in original spreadsheet on the position, specified by the WorksheetNumber (#getWorksheetNumber.getWorksheetNumber/#setWorksheetNumber(int).setWorksheetNumber(int)) property, or it should be injected between existing worksheet and previous one, without replacing its content.
Boolean flag, which specifies whether edited worksheet should replace the existing worksheet in original spreadsheet on the position, specified by the WorksheetNumber (#getWorksheetNumber.getWorksheetNumber/#setWorksheetNumber(int).setWorksheetNumber(int)) property, or it should be injected between existing worksheet and previous one, without replacing its content.
Allows to specify an array with 1-based numbers of worksheets that should be deleted from the spreadsheet during its saving, in case when the edited worksheet is inserted into existing spreadsheet.
Allows to specify an array with 1-based numbers of worksheets that should be deleted from the spreadsheet during its saving, in case when the edited worksheet is inserted into existing spreadsheet.
SpreadsheetSaveOptions()
public SpreadsheetSaveOptions()
This parameterless constructor creates a new instance of SpreadsheetSaveOptions with XLSX output format (can be modified then through OutputFormat (#getOutputFormat.getOutputFormat/#setOutputFormat(SpreadsheetFormats).setOutputFormat(SpreadsheetFormats)) property)
Mandatory output format, in which the Spreadsheet document should be saved
getPassword()
public final String getPassword()
Allows to specify, modify, obtain, or remove a password, which will be used to encode the generated Spreadsheet document, if tis document format supports password protection. Specify NULL or empty string for removing (cleaning) the password.
Returns:
java.lang.String -
setPassword(String value)
public final void setPassword(String value)
Allows to specify, modify, obtain, or remove a password, which will be used to encode the generated Spreadsheet document, if tis document format supports password protection. Specify NULL or empty string for removing (cleaning) the password.
Parameters:
Parameter
Type
Description
value
java.lang.String
getWorksheetNumber()
public final int getWorksheetNumber()
Allows to insert edited worksheet into copy of existing spreadsheet instead of creating a new single-worksheet spreadsheet (default behavior). WorksheetNumber is a 1-based number of a worksheet in the spreadsheet, loaded in the Editor class. If it is 0 (default value), the new spreadsheet will be created with single edited worksheet. If it is greater or lesser then zero, and there is valid spreadsheet, loaded in the Editor class, the edited worksheet, that is represented by input EditableDocument instance, will be inserted into this spreadsheet.
Given spreadsheet has 5 worksheets:
WorksheetNumber = 0; \u2014 ignore given spreadsheet, create a new spreadsheet and put edited worksheet into it.
WorksheetNumber = 1; \u2014 replace the first worksheet with edited
WorksheetNumber = 2; \u2014 replace the second worksheet with edited
WorksheetNumber = 5; \u2014 replace the last (5th) worksheet with edited
WorksheetNumber = 6; \u2014 replace the last (5th) worksheet with edited, because 6 is greater then 5 and thus is adjusted
WorksheetNumber = -1; \u2014 replace the last (5th) worksheet with edited, because "-1" means "last existing"
WorksheetNumber = -2; \u2014 replace the 4th worksheet with edited
WorksheetNumber = -3; \u2014 replace the 3rd worksheet with edited
WorksheetNumber = -4; \u2014 replace the 2nd worksheet with edited
WorksheetNumber = -5; \u2014 replace the first worksheet with edited
WorksheetNumber = -6; \u2014 replace the first worksheet with edited, because "-6" is greater then 5 and thus is adjusted
WorksheetNumber integer property, if it is not in default state (reserved value ‘0’), represents a worksheet number, so it starts from 1, not from zero, and its max value is the amount of all existing slides in a presentation. However, if specified value is greater then amount of all slides, GroupDocs.Editor will adjust it to mark the last worksheet. Negative values are also allowed and count worksheets from end. For example, “-1” implies last worksheet in a spreadsheet, “-2” \u2014 last but one, etc. Like with positive values, when negative worksheet number exceeds the total count of worksheets in the given spreadsheet, it will be adjusted to the first worksheet. The InsertAsNewWorksheet (#getInsertAsNewWorksheet.getInsertAsNewWorksheet/#setInsertAsNewWorksheet(boolean).setInsertAsNewWorksheet(boolean)) boolean property is tightly coupled with this one.
Returns:
int -
setWorksheetNumber(int value)
public final void setWorksheetNumber(int value)
Allows to insert edited worksheet into copy of existing spreadsheet instead of creating a new single-worksheet spreadsheet (default behavior). WorksheetNumber is a 1-based number of a worksheet in the spreadsheet, loaded in the Editor class. If it is 0 (default value), the new spreadsheet will be created with single edited worksheet. If it is greater or lesser then zero, and there is valid spreadsheet, loaded in the Editor class, the edited worksheet, that is represented by input EditableDocument instance, will be inserted into this spreadsheet.
Given spreadsheet has 5 worksheets:
WorksheetNumber = 0; \u2014 ignore given spreadsheet, create a new spreadsheet and put edited worksheet into it.
WorksheetNumber = 1; \u2014 replace the first worksheet with edited
WorksheetNumber = 2; \u2014 replace the second worksheet with edited
WorksheetNumber = 5; \u2014 replace the last (5th) worksheet with edited
WorksheetNumber = 6; \u2014 replace the last (5th) worksheet with edited, because 6 is greater then 5 and thus is adjusted
WorksheetNumber = -1; \u2014 replace the last (5th) worksheet with edited, because "-1" means "last existing"
WorksheetNumber = -2; \u2014 replace the 4th worksheet with edited
WorksheetNumber = -3; \u2014 replace the 3rd worksheet with edited
WorksheetNumber = -4; \u2014 replace the 2nd worksheet with edited
WorksheetNumber = -5; \u2014 replace the first worksheet with edited
WorksheetNumber = -6; \u2014 replace the first worksheet with edited, because "-6" is greater then 5 and thus is adjusted
WorksheetNumber integer property, if it is not in default state (reserved value ‘0’), represents a worksheet number, so it starts from 1, not from zero, and its max value is the amount of all existing slides in a presentation. However, if specified value is greater then amount of all slides, GroupDocs.Editor will adjust it to mark the last worksheet. Negative values are also allowed and count worksheets from end. For example, “-1” implies last worksheet in a spreadsheet, “-2” \u2014 last but one, etc. Like with positive values, when negative worksheet number exceeds the total count of worksheets in the given spreadsheet, it will be adjusted to the first worksheet. The InsertAsNewWorksheet (#getInsertAsNewWorksheet.getInsertAsNewWorksheet/#setInsertAsNewWorksheet(boolean).setInsertAsNewWorksheet(boolean)) boolean property is tightly coupled with this one.
Parameters:
Parameter
Type
Description
value
int
getInsertAsNewWorksheet()
public final boolean getInsertAsNewWorksheet()
Boolean flag, which specifies whether edited worksheet should replace the existing worksheet in original spreadsheet on the position, specified by the WorksheetNumber (#getWorksheetNumber.getWorksheetNumber/#setWorksheetNumber(int).setWorksheetNumber(int)) property, or it should be injected between existing worksheet and previous one, without replacing its content. By default is false \u2014 existing worksheet will be replaced. This property is ignored, if value of WorksheetNumber (#getWorksheetNumber.getWorksheetNumber/#setWorksheetNumber(int).setWorksheetNumber(int)) property is set to ‘0’.
By default worksheet is replaced. This means that if given spreadsheet has 5 worksheets, and WorksheetNumber (#getWorksheetNumber.getWorksheetNumber/#setWorksheetNumber(int).setWorksheetNumber(int))=4, then 4th worksheet will be replaced with the new edited worksheet, while the total amount of worksheets in spreadsheet (5) will remain untouched. However, if value of this property is set to true , the new edited worksheet will be injected as 4th worksheet, and all subsequent worksheets will be shifted to the end: “old” 4th worksheet becomes 5th, and 5th becomes 6th, and the total amount of worksheets in spreadsheet will be incremented by one and equal to 6.
Returns:
boolean -
setInsertAsNewWorksheet(boolean value)
public final void setInsertAsNewWorksheet(boolean value)
Boolean flag, which specifies whether edited worksheet should replace the existing worksheet in original spreadsheet on the position, specified by the WorksheetNumber (#getWorksheetNumber.getWorksheetNumber/#setWorksheetNumber(int).setWorksheetNumber(int)) property, or it should be injected between existing worksheet and previous one, without replacing its content. By default is false \u2014 existing worksheet will be replaced. This property is ignored, if value of WorksheetNumber (#getWorksheetNumber.getWorksheetNumber/#setWorksheetNumber(int).setWorksheetNumber(int)) property is set to ‘0’.
By default worksheet is replaced. This means that if given spreadsheet has 5 worksheets, and WorksheetNumber (#getWorksheetNumber.getWorksheetNumber/#setWorksheetNumber(int).setWorksheetNumber(int))=4, then 4th worksheet will be replaced with the new edited worksheet, while the total amount of worksheets in spreadsheet (5) will remain untouched. However, if value of this property is set to true , the new edited worksheet will be injected as 4th worksheet, and all subsequent worksheets will be shifted to the end: “old” 4th worksheet becomes 5th, and 5th becomes 6th, and the total amount of worksheets in spreadsheet will be incremented by one and equal to 6.
Parameters:
Parameter
Type
Description
value
boolean
getOutputFormat()
public final SpreadsheetFormats getOutputFormat()
Allows to specify a Spreadsheet format, which will be used for saving the document
public final WorksheetProtection getWorksheetProtection()
Allows to enable a worksheet protection for the output Spreadsheet document. By default is NULL - protection is not applied. Not all formats support a worksheet protection.
public final void setWorksheetProtection(WorksheetProtection value)
Allows to enable a worksheet protection for the output Spreadsheet document. By default is NULL - protection is not applied. Not all formats support a worksheet protection.
Allows to specify an array with 1-based numbers of worksheets that should be deleted from the spreadsheet during its saving, in case when the edited worksheet is inserted into existing spreadsheet.When the edited worksheet is saved not as a new single-worksheet spreadsheet (default behavior), but instead is saved into an existing spreadsheet (using #getWorksheetNumber().getWorksheetNumber() / #setWorksheetNumber(int).setWorksheetNumber(int)), it is also possible to delete some particular worksheets from this spreadsheet by specifying their numbers in this array. By default this array is null \u2014 no worksheets will be deleted. However, when this array is non-null and non-empty, and it contains at least one valid worksheet number, after the output spreadsheet document is generated with the content of the edited worksheet, the worksheets with specified numbers will be deleted from the spreadsheet right before writing its content to the output stream or file. Worksheet numbers in this array are 1-based, not 0-based. Invalid numbers (less than 1 or greater than the total number of worksheets) will be ignored.
Returns:
int[] - Array of 1-based worksheet numbers to delete, or null if nothing should be deleted.
setWorksheetNumbersToDelete(int[] value)
public final void setWorksheetNumbersToDelete(int[] value)
Allows to specify an array with 1-based numbers of worksheets that should be deleted from the spreadsheet during its saving, in case when the edited worksheet is inserted into existing spreadsheet.Worksheet numbers in this array are 1-based. Invalid numbers will be ignored.
Parameters:
Parameter
Type
Description
value
int[]
Array of 1-based worksheet numbers to delete (may be null or empty).
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.