Methods

addArea(cellArea)

Applies the validation to the area. It is equivalent to use addArea(com.aspose.cells.CellArea, boolean, boolean) with checking intersection and edge.

Parameter

Name Type Optional Description

cellArea

CellArea

 

The area.

addArea(cellArea, checkIntersection, checkEdge)

Applies the validation to the area. In this method, we will remove all old validations in given area. For the top-left one of Validation's applied ranges, firstly its StartRow is smallest, secondly its StartColumn is the smallest one of those areas who have the same smallest StartRow.

Parameters

Name Type Optional Description

cellArea

CellArea

 

The area.

checkIntersection

boolean

 

Whether check the intersection of given area with existing validations' areas. If one validation has been applied in given area(or part of it), then the existing validation should be removed at first from given area. Otherwise corruption may be caused for the generated Validations. If user is sure that the added area does not intersect with any existing area, this parameter can be set as false for performance consideration.

checkEdge

boolean

 

Whether check the edge of this validation's applied areas. Validation's internal settings depend on the top-left one of its applied ranges, so if given area will become the new top-left one of the applied ranges, the internal settings should be changed and rebuilt, otherwise unexpected result may be caused. If user is sure that the added area is not the top-left one, this parameter can be set as false for performance consideration.

addAreas(areas, checkIntersection, checkEdge)

Applies the validation to given areas. In this method, we will remove all old validations in given area. For the top-left one of Validation's applied ranges, firstly its StartRow is smallest, secondly its StartColumn is the smallest one of those areas who have the same smallest StartRow.

Parameters

Name Type Optional Description

areas

Array of CellArea

 

The areas.

checkIntersection

boolean

 

Whether check the intersection of given area with existing validations' areas. If one validation has been applied in given area(or part of it), then the existing validation should be removed at first from given area. Otherwise corruption may be caused for the generated Validations. If user is sure that all the added areas do not intersect with any existing area, this parameter can be set as false for performance consideration.

checkEdge

boolean

 

Whether check the edge of this validation's applied areas. Validation's internal settings depend on the top-left one of its applied ranges, so if one of given areas will become the new top-left one of the applied ranges, the internal settings should be changed and rebuilt, otherwise unexpected result may be caused. If user is sure that no one of those added areas is the top-left, this parameter can be set as false for performance consideration.

copy(source, copyOption)

Copy validation.

Parameters

Name Type Optional Description

source

Validation

 

The source validation.

copyOption

CopyOptions

 

The copy option.

getAlertStyle()

Represents the validation alert style. The value of the property is ValidationAlertType integer constant.

getAreas()

Gets all CellArea which contain the data validation settings.

getErrorMessage()

Represents the data validation error message.

getErrorTitle()

Represents the title of the data-validation error dialog box.

getFormula1()

Represents the value or expression associated with the data validation.

getFormula1(isR1C1, isLocal) → String

Gets the value or expression associated with this validation.

Parameters

Name Type Optional Description

isR1C1

boolean

 

Whether the formula needs to be formatted as R1C1.

isLocal

boolean

 

Whether the formula needs to be formatted by locale.

Returns

String The value or expression associated with this validation.

getFormula1(isR1C1, isLocal, row, column) → String

Gets the value or expression associated with this validation for specific cell.

Parameters

Name Type Optional Description

isR1C1

boolean

 

Whether the formula needs to be formatted as R1C1.

isLocal

boolean

 

Whether the formula needs to be formatted by locale.

row

Number

 

The row index.

column

Number

 

The column index.

Returns

String The value or expression associated with this validation.

getFormula2()

Represents the value or expression associated with the data validation.

getFormula2(isR1C1, isLocal) → String

Gets the value or expression associated with this validation.

Parameters

Name Type Optional Description

isR1C1

boolean

 

Whether the formula needs to be formatted as R1C1.

isLocal

boolean

 

Whether the formula needs to be formatted by locale.

Returns

String The value or expression associated with this validation.

getFormula2(isR1C1, isLocal, row, column) → String

Gets the value or expression associated with this validation for specific cell.

Parameters

Name Type Optional Description

isR1C1

boolean

 

Whether the formula needs to be formatted as R1C1.

isLocal

boolean

 

Whether the formula needs to be formatted by locale.

row

Number

 

The row index.

column

Number

 

The column index.

Returns

String The value or expression associated with this validation.

getIgnoreBlank()

Indicates whether blank values are permitted by the range data validation.

getInCellDropDown()

Indicates whether data validation displays a drop-down list that contains acceptable values.

getInputMessage()

Represents the data validation input message.

getInputTitle()

Represents the title of the data-validation input dialog box.

getListValue(row, column) → Object

Get the value for list of the validation for the specified cell. Only for validation whose type is List and has been applied to given cell, otherwise null will be returned.

Parameters

Name Type Optional Description

row

Number

 

The row index.

column

Number

 

The column index.

Returns

Object The value to produce the list of this validation for the specified cell. If the list references to a range, then the returned value will be a ReferredArea object; Otherwise the returned value may be null, object[], or simple object.

getOperator()

Represents the operator for the data validation. The value of the property is OperatorType integer constant.

getShowError()

Indicates whether the data validation error message will be displayed whenever the user enters invalid data.

getShowInput()

Indicates whether the data validation input message will be displayed whenever the user selects a cell in the data validation range.

getType()

Represents the data validation type. The value of the property is ValidationType integer constant.

getValue(row, column, isValue1) → Object

Get the value of validation on the specific cell.

Parameters

Name Type Optional Description

row

Number

 

The row index.

column

Number

 

The column index.

isValue1

boolean

 

Indicates whether getting the first value.

Returns

Object 

getValue1()

Represents the first value associated with the data validation.

getValue2()

Represents the second value associated with the data validation.

removeACell(row, column)

Remove the validation settings in the cell.

Parameters

Name Type Optional Description

row

Number

 

The row index.

column

Number

 

The column index.

removeArea(cellArea)

Remove the validation settings in the range.

Parameter

Name Type Optional Description

cellArea

CellArea

 

the areas where this validation settings should be removed.

removeAreas(areas)

Removes this validation from given areas.

Parameter

Name Type Optional Description

areas

Array of CellArea

 

the areas where this validation settings should be removed.

setAlertStyle()

Represents the validation alert style. The value of the property is ValidationAlertType integer constant.

setErrorMessage()

Represents the data validation error message.

setErrorTitle()

Represents the title of the data-validation error dialog box.

setFormula1()

Represents the value or expression associated with the data validation.

setFormula1(formula, isR1C1, isLocal)

Sets the value or expression associated with this validation.

Parameters

Name Type Optional Description

formula

String

 

The value or expression associated with this format condition.

isR1C1

boolean

 

Whether the formula is R1C1 formula.

isLocal

boolean

 

Whether the formula is locale formatted.

setFormula2()

Represents the value or expression associated with the data validation.

setFormula2(formula, isR1C1, isLocal)

Sets the value or expression associated with this validation.

Parameters

Name Type Optional Description

formula

String

 

The value or expression associated with this format condition.

isR1C1

boolean

 

Whether the formula is R1C1 formula.

isLocal

boolean

 

Whether the formula is locale formatted.

setIgnoreBlank()

Indicates whether blank values are permitted by the range data validation.

setInCellDropDown()

Indicates whether data validation displays a drop-down list that contains acceptable values.

setInputMessage()

Represents the data validation input message.

setInputTitle()

Represents the title of the data-validation input dialog box.

setOperator()

Represents the operator for the data validation. The value of the property is OperatorType integer constant.

setShowError()

Indicates whether the data validation error message will be displayed whenever the user enters invalid data.

setShowInput()

Indicates whether the data validation input message will be displayed whenever the user selects a cell in the data validation range.

setType()

Represents the data validation type. The value of the property is ValidationType integer constant.

setValue1()

Represents the first value associated with the data validation.

setValue2()

Represents the second value associated with the data validation.