FindOptions
FindOptions class
Represents find options.
class FindOptions;
Example
const { Workbook, FindOptions, CellArea, LookInType } = require("aspose.cells.node");
//Instantiate the workbook object
var workbook = new Workbook("input/Book1.xls");
//Get Cells collection
var cells = workbook.getWorksheets().get(0).getCells();
//Instantiate FindOptions Object
var findOptions = new FindOptions();
//Create a Cells Area
var ca = new CellArea();
ca.startRow = 8;
ca.startColumn = 2;
ca.endRow = 17;
ca.endColumn = 13;
//Set cells area for find options
findOptions.setRange(ca);
//Set searching properties
findOptions.setSearchBackward(false);
findOptions.setSearchOrderByRows(true);
findOptions.setLookInType(LookInType.Values);
//Find the cell with 0 value
var cell = cells.find(0, null, findOptions);
Constructors
Name | Description |
---|---|
constructor() | Default Constructor. |
Methods
Method | Description |
---|---|
getCaseSensitive() | Indicates if the searched string is case sensitive. |
setCaseSensitive(boolean) | Indicates if the searched string is case sensitive. |
getLookAtType() | Look at type. |
setLookAtType(LookAtType) | Look at type. |
isRangeSet() | Indicates whether the searched range is set. |
getSearchBackward() | Whether search backward for cells. |
setSearchBackward(boolean) | Whether search backward for cells. |
getSearchOrderByRows() | Indicates whether search order by rows or columns. |
setSearchOrderByRows(boolean) | Indicates whether search order by rows or columns. |
getLookInType() | Look in type. |
setLookInType(LookInType) | Look in type. |
getRegexKey() | Indicates whether the searched key is regex. If true the searched key will be taken as regex and parsed. Otherwise the key will be parsed according to the rules in ms excel. |
setRegexKey(boolean) | Indicates whether the searched key is regex. If true the searched key will be taken as regex and parsed. Otherwise the key will be parsed according to the rules in ms excel. |
getValueTypeSensitive() | Indicates whether searched cell value type should be same with the searched key. |
setValueTypeSensitive(boolean) | Indicates whether searched cell value type should be same with the searched key. |
getStyle() | The format to search for. |
setStyle(Style) | The format to search for. |
getConvertNumericData() | Gets or sets a value that indicates whether converting the searched string value to numeric data. |
setConvertNumericData(boolean) | Gets or sets a value that indicates whether converting the searched string value to numeric data. |
getRange() | Gets and sets the searched range. |
setRange(CellArea) | Sets the searched range. |
isNull() | Checks whether the implementation object is null. |
constructor()
Default Constructor.
constructor();
getCaseSensitive()
Indicates if the searched string is case sensitive.
getCaseSensitive() : boolean;
setCaseSensitive(boolean)
Indicates if the searched string is case sensitive.
setCaseSensitive(value: boolean) : void;
Parameters:
Parameter | Type | Description |
---|---|---|
value | boolean | The value to set. |
getLookAtType()
Look at type.
getLookAtType() : LookAtType;
Returns
Remarks
When RegexKey is true and user has specified the exact rule for the regex, for performance consideration this property should be set as LookAtType.EntireContent. Otherwise we will refactor the search key to ensure it can be matched according to the specific type. For example, when the type is LookAtType.Contains(this is the default value for this property), we will add wildcards at the beginning and end of the search key automatically. In this case, the regular expressions will become more complex and the performance will also decrease.
setLookAtType(LookAtType)
Look at type.
setLookAtType(value: LookAtType) : void;
Parameters:
Parameter | Type | Description |
---|---|---|
value | LookAtType | The value to set. |
Remarks
When RegexKey is true and user has specified the exact rule for the regex, for performance consideration this property should be set as LookAtType.EntireContent. Otherwise we will refactor the search key to ensure it can be matched according to the specific type. For example, when the type is LookAtType.Contains(this is the default value for this property), we will add wildcards at the beginning and end of the search key automatically. In this case, the regular expressions will become more complex and the performance will also decrease.
isRangeSet()
Indicates whether the searched range is set.
isRangeSet() : boolean;
getSearchBackward()
Whether search backward for cells.
getSearchBackward() : boolean;
setSearchBackward(boolean)
Whether search backward for cells.
setSearchBackward(value: boolean) : void;
Parameters:
Parameter | Type | Description |
---|---|---|
value | boolean | The value to set. |
getSearchOrderByRows()
Indicates whether search order by rows or columns.
getSearchOrderByRows() : boolean;
setSearchOrderByRows(boolean)
Indicates whether search order by rows or columns.
setSearchOrderByRows(value: boolean) : void;
Parameters:
Parameter | Type | Description |
---|---|---|
value | boolean | The value to set. |
getLookInType()
Look in type.
getLookInType() : LookInType;
Returns
setLookInType(LookInType)
Look in type.
setLookInType(value: LookInType) : void;
Parameters:
Parameter | Type | Description |
---|---|---|
value | LookInType | The value to set. |
getRegexKey()
Indicates whether the searched key is regex. If true the searched key will be taken as regex and parsed. Otherwise the key will be parsed according to the rules in ms excel.
getRegexKey() : boolean;
Remarks
Even though the search key has been specified as regex, it may be refactored according to specified LookAtType. For example, when the type is LookAtType.Contains(this is the default value for this options), wildcards will be added at the beginning and end of the search key automatically to ensure the match will be checked as “contains”. In this case, the regular expressions will become more complex and the performance will also decrease. So, for performance consideration, if user has specified the exact rule for the regex, then there is no need to use LookAtType as additional constraint and user may set it as LookAtType.EntireContent to get better performance.
setRegexKey(boolean)
Indicates whether the searched key is regex. If true the searched key will be taken as regex and parsed. Otherwise the key will be parsed according to the rules in ms excel.
setRegexKey(value: boolean) : void;
Parameters:
Parameter | Type | Description |
---|---|---|
value | boolean | The value to set. |
Remarks
Even though the search key has been specified as regex, it may be refactored according to specified LookAtType. For example, when the type is LookAtType.Contains(this is the default value for this options), wildcards will be added at the beginning and end of the search key automatically to ensure the match will be checked as “contains”. In this case, the regular expressions will become more complex and the performance will also decrease. So, for performance consideration, if user has specified the exact rule for the regex, then there is no need to use LookAtType as additional constraint and user may set it as LookAtType.EntireContent to get better performance.
getValueTypeSensitive()
Indicates whether searched cell value type should be same with the searched key.
getValueTypeSensitive() : boolean;
setValueTypeSensitive(boolean)
Indicates whether searched cell value type should be same with the searched key.
setValueTypeSensitive(value: boolean) : void;
Parameters:
Parameter | Type | Description |
---|---|---|
value | boolean | The value to set. |
getStyle()
The format to search for.
getStyle() : Style;
Returns
setStyle(Style)
The format to search for.
setStyle(value: Style) : void;
Parameters:
Parameter | Type | Description |
---|---|---|
value | Style | The value to set. |
getConvertNumericData()
Gets or sets a value that indicates whether converting the searched string value to numeric data.
getConvertNumericData() : boolean;
setConvertNumericData(boolean)
Gets or sets a value that indicates whether converting the searched string value to numeric data.
setConvertNumericData(value: boolean) : void;
Parameters:
Parameter | Type | Description |
---|---|---|
value | boolean | The value to set. |
getRange()
Gets and sets the searched range.
getRange() : CellArea;
Returns
Returns the searched range.
setRange(CellArea)
Sets the searched range.
setRange(ca: CellArea) : void;
Parameters:
Parameter | Type | Description |
---|---|---|
ca | CellArea | the searched range. |
isNull()
Checks whether the implementation object is null.
isNull() : boolean;