DeleteBlankOptions

DeleteBlankOptions class

Represents the setting of deleting blank cells/rows/columns.

class DeleteBlankOptions extends DeleteOptions;

Constructors

NameDescription
constructor(DeleteOptions)Constructs from a parent object convertible to this.
constructor()Default Constructor.

Methods

MethodDescription
getEmptyStringAsBlank()Whether one cell will be taken as blank when its value is empty string. Default value is true.
setEmptyStringAsBlank(boolean)Whether one cell will be taken as blank when its value is empty string. Default value is true.
getEmptyFormulaValueAsBlank()Whether one cell will be taken as blank when it is formula and the calculated result is null or empty string. Default value is false.
setEmptyFormulaValueAsBlank(boolean)Whether one cell will be taken as blank when it is formula and the calculated result is null or empty string. Default value is false.
getDrawingsAsBlank()Whether drawing related objects such as picture, shape, chart… will be taken as blank. Default value is true.
setDrawingsAsBlank(boolean)Whether drawing related objects such as picture, shape, chart… will be taken as blank. Default value is true.
getMergedCellsShrinkType()Indicates how to process merged cells when deleting blank rows/columns.
setMergedCellsShrinkType(MergedCellsShrinkType)Indicates how to process merged cells when deleting blank rows/columns.
getStartIndex()Specifies the start row/column index of the range to check and delete blank rows/columns.
setStartIndex(number)Specifies the start row/column index of the range to check and delete blank rows/columns.
getEndIndex()Specifies the end row/column index(inclusive) of the range to check and delete blank rows/columns. Default value is -1 and -1 means the maximum range of all objects(cells, drawings, …) that need to be checked.
setEndIndex(number)Specifies the end row/column index(inclusive) of the range to check and delete blank rows/columns. Default value is -1 and -1 means the maximum range of all objects(cells, drawings, …) that need to be checked.
isNull()Checks whether the implementation object is null.
getUpdateReference()Indicates if update references in other worksheets.
setUpdateReference(boolean)Indicates if update references in other worksheets.

constructor(DeleteOptions)

Constructs from a parent object convertible to this.

constructor(obj: DeleteOptions);

Parameters:

ParameterTypeDescription
objDeleteOptionsThe parent object.

constructor()

Default Constructor.

constructor();

getEmptyStringAsBlank()

Whether one cell will be taken as blank when its value is empty string. Default value is true.

getEmptyStringAsBlank() : boolean;

setEmptyStringAsBlank(boolean)

Whether one cell will be taken as blank when its value is empty string. Default value is true.

setEmptyStringAsBlank(value: boolean) : void;

Parameters:

ParameterTypeDescription
valuebooleanThe value to set.

getEmptyFormulaValueAsBlank()

Whether one cell will be taken as blank when it is formula and the calculated result is null or empty string. Default value is false.

getEmptyFormulaValueAsBlank() : boolean;

Remarks

Generally user should make sure the formulas have been calculated before deleting operation with this property as true. Otherwise all newly cretaed formulas by normal apis such as Cell.Formula will be taken as blank and may be deleted because before calculation their calculated results are all null.

setEmptyFormulaValueAsBlank(boolean)

Whether one cell will be taken as blank when it is formula and the calculated result is null or empty string. Default value is false.

setEmptyFormulaValueAsBlank(value: boolean) : void;

Parameters:

ParameterTypeDescription
valuebooleanThe value to set.

Remarks

Generally user should make sure the formulas have been calculated before deleting operation with this property as true. Otherwise all newly cretaed formulas by normal apis such as Cell.Formula will be taken as blank and may be deleted because before calculation their calculated results are all null.

getDrawingsAsBlank()

Whether drawing related objects such as picture, shape, chart… will be taken as blank. Default value is true.

getDrawingsAsBlank() : boolean;

Remarks

When setting this property as false, all rows/columns covered by drawing objects will not be taken as blank and will not be deleted.

setDrawingsAsBlank(boolean)

Whether drawing related objects such as picture, shape, chart… will be taken as blank. Default value is true.

setDrawingsAsBlank(value: boolean) : void;

Parameters:

ParameterTypeDescription
valuebooleanThe value to set.

Remarks

When setting this property as false, all rows/columns covered by drawing objects will not be taken as blank and will not be deleted.

getMergedCellsShrinkType()

Indicates how to process merged cells when deleting blank rows/columns.

getMergedCellsShrinkType() : MergedCellsShrinkType;

Returns

MergedCellsShrinkType

Remarks

For MergedCellsShrinkType.KeepHeaderOnly, all cells in it will be taken as blank except the non-blank top-left cell. It is the default value of this property.

For MergedCellsShrinkType.None, all cells in it will be taken as non-blank.

For MergedCellsShrinkType.ShrinkToFit, all cells outside the content display area will be taken as blank.
</br

setMergedCellsShrinkType(MergedCellsShrinkType)

Indicates how to process merged cells when deleting blank rows/columns.

setMergedCellsShrinkType(value: MergedCellsShrinkType) : void;

Parameters:

ParameterTypeDescription
valueMergedCellsShrinkTypeThe value to set.

Remarks

For MergedCellsShrinkType.KeepHeaderOnly, all cells in it will be taken as blank except the non-blank top-left cell. It is the default value of this property.

For MergedCellsShrinkType.None, all cells in it will be taken as non-blank.

For MergedCellsShrinkType.ShrinkToFit, all cells outside the content display area will be taken as blank.
</br

getStartIndex()

Specifies the start row/column index of the range to check and delete blank rows/columns.

getStartIndex() : number;

setStartIndex(number)

Specifies the start row/column index of the range to check and delete blank rows/columns.

setStartIndex(value: number) : void;

Parameters:

ParameterTypeDescription
valuenumberThe value to set.

getEndIndex()

Specifies the end row/column index(inclusive) of the range to check and delete blank rows/columns. Default value is -1 and -1 means the maximum range of all objects(cells, drawings, …) that need to be checked.

getEndIndex() : number;

setEndIndex(number)

Specifies the end row/column index(inclusive) of the range to check and delete blank rows/columns. Default value is -1 and -1 means the maximum range of all objects(cells, drawings, …) that need to be checked.

setEndIndex(value: number) : void;

Parameters:

ParameterTypeDescription
valuenumberThe value to set.

isNull()

Checks whether the implementation object is null.

isNull() : boolean;

getUpdateReference()

Indicates if update references in other worksheets.

getUpdateReference() : boolean;

setUpdateReference(boolean)

Indicates if update references in other worksheets.

setUpdateReference(value: boolean) : void;

Parameters:

ParameterTypeDescription
valuebooleanThe value to set.