Example:
workbook = Workbook() validations = workbook.getWorksheets().get(0).getValidations() validation = validations.get(validations.add()) validation.setType(ValidationType.WHOLE_NUMBER) validation.setOperator(OperatorType.BETWEEN) validation.setFormula1("3") validation.setFormula2("1234") area = CellArea() area.StartRow = 0 area.EndRow = 1 area.StartColumn = 0 area.EndColumn = 1 validation.addArea(area)
Property Getters/Setters Summary | ||
---|---|---|
method | getAlertStyle() | |
method | setAlertStyle(value) | |
Represents the validation alert style. The value of the property is ValidationAlertType integer constant. | ||
method | getAreas() | |
Gets all |
||
method | getErrorMessage() | |
method | setErrorMessage(value) | |
Represents the data validation error message. | ||
method | getErrorTitle() | |
method | setErrorTitle(value) | |
Represents the title of the data-validation error dialog box. | ||
method | getFormula1() | |
method | setFormula1(value) | |
Represents the value or expression associated with the data validation. | ||
method | getFormula2() | |
method | setFormula2(value) | |
Represents the value or expression associated with the data validation. | ||
method | getIgnoreBlank() | |
method | setIgnoreBlank(value) | |
Indicates whether blank values are permitted by the range data validation. | ||
method | getInCellDropDown() | |
method | setInCellDropDown(value) | |
Indicates whether data validation displays a drop-down list that contains acceptable values. | ||
method | getInputMessage() | |
method | setInputMessage(value) | |
Represents the data validation input message. | ||
method | getInputTitle() | |
method | setInputTitle(value) | |
Represents the title of the data-validation input dialog box. | ||
method | getOperator() | |
method | setOperator(value) | |
Represents the operator for the data validation. The value of the property is OperatorType integer constant. | ||
method | getShowError() | |
method | setShowError(value) | |
Indicates whether the data validation error message will be displayed whenever the user enters invalid data. | ||
method | getShowInput() | |
method | setShowInput(value) | |
Indicates whether the data validation input message will be displayed whenever the user selects a cell in the data validation range. | ||
method | getType() | |
method | setType(value) | |
Represents the data validation type. The value of the property is ValidationType integer constant. | ||
method | getValue1() | |
method | setValue1(value) | |
Represents the first value associated with the data validation. | ||
method | getValue2() | |
method | setValue2(value) | |
Represents the second value associated with the data validation. |
Method Summary | ||
---|---|---|
method | addArea(cellArea) | |
Applies the validation to the area.
|
||
method | addArea(cellArea, checkIntersection, checkEdge) | |
Applies the validation to the area.
|
||
method | addAreas(areas, checkIntersection, checkEdge) | |
Applies the validation to given areas.
|
||
method | copy(source, copyOption) | |
Copy validation.
|
||
method | getFormula1(isR1C1, isLocal) | |
Gets the value or expression associated with this validation.
|
||
method | getFormula1(isR1C1, isLocal, row, column) | |
Gets the value or expression associated with this validation for specific cell.
|
||
method | getFormula2(isR1C1, isLocal) | |
Gets the value or expression associated with this validation.
|
||
method | getFormula2(isR1C1, isLocal, row, column) | |
Gets the value or expression associated with this validation for specific cell.
|
||
method | getListValue(row, column) | |
Get the value for list of the validation for the specified cell.
|
||
method | getValue(row, column, isValue1) | |
Get the value of validation on the specific cell.
|
||
method | removeACell(row, column) | |
Remove the validation settings in the cell.
|
||
method | removeArea(cellArea) | |
Remove the validation settings in the range.
|
||
method | removeAreas(areas) | |
Removes this validation from given areas.
|
||
method | setFormula1(formula, isR1C1, isLocal) | |
Sets the value or expression associated with this validation.
|
||
method | setFormula2(formula, isR1C1, isLocal) | |
Sets the value or expression associated with this validation.
|
int getOperator() / setOperator(value)
int getAlertStyle() / setAlertStyle(value)
int getType() / setType(value)
String getInputMessage() / setInputMessage(value)
String getInputTitle() / setInputTitle(value)
String getErrorMessage() / setErrorMessage(value)
String getErrorTitle() / setErrorTitle(value)
boolean getShowInput() / setShowInput(value)
boolean getShowError() / setShowError(value)
boolean getIgnoreBlank() / setIgnoreBlank(value)
String getFormula1() / setFormula1(value)
String getFormula2() / setFormula2(value)
Object getValue1() / setValue1(value)
Object getValue2() / setValue2(value)
boolean getInCellDropDown() / setInCellDropDown(value)
CellArea[] getAreas()
String getFormula1(isR1C1, isLocal)
isR1C1: boolean
- Whether the formula needs to be formatted as R1C1.isLocal: boolean
- Whether the formula needs to be formatted by locale.String getFormula2(isR1C1, isLocal)
isR1C1: boolean
- Whether the formula needs to be formatted as R1C1.isLocal: boolean
- Whether the formula needs to be formatted by locale.String getFormula1(isR1C1, isLocal, row, column)
isR1C1: boolean
- Whether the formula needs to be formatted as R1C1.isLocal: boolean
- Whether the formula needs to be formatted by locale.row: int
- The row index.column: int
- The column index.String getFormula2(isR1C1, isLocal, row, column)
isR1C1: boolean
- Whether the formula needs to be formatted as R1C1.isLocal: boolean
- Whether the formula needs to be formatted by locale.row: int
- The row index.column: int
- The column index.setFormula1(formula, isR1C1, isLocal)
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(formula, isR1C1, isLocal)
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.Object getListValue(row, column)
row: int
- The row index.column: int
- The column index.Object getValue(row, column, isValue1)
row: int
- The row index.column: int
- The column index.isValue1: boolean
- Indicates whether getting the first value.addArea(cellArea)
cellArea: CellArea
- The area.addArea(cellArea, checkIntersection, checkEdge)
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)
areas: 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.removeArea(cellArea)
cellArea: CellArea
- the areas where this validation settings should be removed.removeAreas(areas)
areas: CellArea[]
- the areas where this validation settings should be removed.removeACell(row, column)
row: int
- The row index.column: int
- The column index.copy(source, copyOption)
source: Validation
- The source validation.copyOption: CopyOptions
- The copy option.