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