Example:
//Instantiate the workbook object
$workbook = new cells\Workbook("Book1.xls");
//Get Cells collection
$cells = $workbook->getWorksheets()->get(0)->getCells();
//Instantiate FindOptions Object
$findOptions = new cells\FindOptions();
//Create a Cells Area
$ca = new cells\CellArea();
$ca->StartRow = 0;
$ca->StartColumn = 0;
$ca->EndRow = 17;
$ca->EndColumn = 13;
//Set cells area for find options
$findOptions->setRange($ca);
//Set searching properties
$findOptions->setSearchNext(true);
$findOptions->setSeachOrderByRows(true);
$findOptions->setLookInType(cells\LookInType::VALUES);
//Find the cell with 0 value
$cell =$cells->find("a", null, $findOptions);
echo "Found cell: ".$cell."\n";
| Constructor Summary |
|---|
FindOptions()
|
| Property Getters/Setters Summary | ||
|---|---|---|
function | getCaseSensitive() | |
function | setCaseSensitive(value) | |
| Indicates if the searched string is case sensitive. | ||
function | getConvertNumericData() | |
function | setConvertNumericData(value) | |
| Gets or sets a value that indicates whether converting the searched string value to numeric data. | ||
void | setCaseSensitive(value) | |
| Indicates if the searched string is case sensitive. | ||
function | isRangeSet() | |
| Indicates whether the searched range is set. | ||
function | getLookAtType() | |
function | setLookAtType(value) | |
| Look at type. The value of the property is LookAtType integer constant. | ||
function | getLookInType() | |
function | setLookInType(value) | |
| Look in type. The value of the property is LookInType integer constant. | ||
function | getRegexKey() | |
function | setRegexKey(value) | |
| Indicates whether the searched key is regex. If true then the searched key will be taken as regex. | ||
function | getSeachOrderByRows() | |
function | setSeachOrderByRows(value) | |
| Indicates whether search order by rows or columns. | ||
function | getSearchBackward() | |
function | setSearchBackward(value) | |
| Whether search backward for cells. | ||
function | getSearchNext() | |
function | setSearchNext(value) | |
| Search order. True: search next. False: search previous. | ||
function | getStyle() | |
function | setStyle(value) | |
| The format to search for. | ||
function | getValueTypeSensitive() | |
function | setValueTypeSensitive(value) | |
| Indicates whether searched cell value type should be same with the searched key. | ||
| Method Summary | ||
|---|---|---|
function | getRange() | |
| Gets and sets the searched range. | ||
function | setRange(ca) | |
| Sets the searched range. | ||
| Constructor Detail |
|---|
function FindOptions()
| Property Getters/Setters Detail |
|---|
setCaseSensitive : boolean | |
function setCaseSensitive(value) | |
getCaseSensitive/setCaseSensitive : boolean | |
function getCaseSensitive() / function setCaseSensitive(value) | |
getLookAtType/setLookAtType : Number | |
function getLookAtType() / function setLookAtType(value) | |
isRangeSet : boolean | |
function isRangeSet() | |
getSearchNext/setSearchNext : boolean | |
function getSearchNext() / function setSearchNext(value) | |
getSearchBackward/setSearchBackward : boolean | |
function getSearchBackward() / function setSearchBackward(value) | |
getSeachOrderByRows/setSeachOrderByRows : boolean | |
function getSeachOrderByRows() / function setSeachOrderByRows(value) | |
getLookInType/setLookInType : Number | |
function getLookInType() / function setLookInType(value) | |
getRegexKey/setRegexKey : boolean | |
function getRegexKey() / function setRegexKey(value) | |
getValueTypeSensitive/setValueTypeSensitive : boolean | |
function getValueTypeSensitive() / function setValueTypeSensitive(value) | |
getStyle/setStyle : Style | |
function getStyle() / function setStyle(value) | |
getConvertNumericData/setConvertNumericData : boolean | |
function getConvertNumericData() / function setConvertNumericData(value) | |
| Method Detail |
|---|
getRange | |
function getRange() | |
setRange | |
function setRange(ca) | |
ca: CellArea - the searched range.