Worksheet
Worksheet class
Encapsulates the object that represents a single worksheet.
Properties
| Name | Type | Description |
|---|---|---|
| Protection | Protection | Represents the various types of protection options available for a worksheet. Supports advanced protection options in Ex |
| UniqueId | String | Gets and sets the unique id, it is same as {15DB5C3C-A5A1-48AF-8F25-3D86AC232D4F}. |
| Workbook | Workbook | Gets the workbook object which contains this sheet. |
| Cells | Cells | Gets the Cells collection. |
| QueryTables | QueryTableCollection | Gets QueryTableCollection in the worksheet. |
| Type | int | Represents worksheet type. The value of the property is SheetType integer constant. |
| Name | String | Gets or sets the name of the worksheet. The max length of sheet name is 31. And you cannot assign same name(case insensi |
| ShowFormulas | boolean | Indicates whether to show formulas or their results. |
| ShowDataTypeIcons | boolean | |
| IsGridlinesVisible | boolean | Gets or sets a value indicating whether the gridlines are visible.Default is true. |
| IsRowColumnHeadersVisible | boolean | Gets or sets a value indicating whether the worksheet will display row and column headers. Default is true. |
| PaneState | int | Indicates whether the pane has horizontal or vertical splits, and whether those splits are frozen. The value of the prop |
| DisplayZeros | boolean | True if zero values are displayed. |
| DisplayRightToLeft | boolean | Indicates if the specified worksheet is displayed from right to left instead of from left to right. Default is false. |
| IsOutlineShown | boolean | Indicates whether to show outline. |
| IsSelected | boolean | Indicates whether this worksheet is selected when the workbook is opened. |
| PivotTables | PivotTableCollection | Gets all pivot tables in this worksheet. |
| ListObjects | ListObjectCollection | Gets all ListObjects in this worksheet. |
| TabId | int | Specifies the internal identifier for the sheet. |
| HorizontalPageBreaks | HorizontalPageBreakCollection | Gets the HorizontalPageBreakCollection collection. |
| VerticalPageBreaks | VerticalPageBreakCollection | Gets the VerticalPageBreakCollection collection. |
| Hyperlinks | HyperlinkCollection | Gets the HyperlinkCollection collection. |
| PageSetup | PageSetup | Represents the page setup description in this sheet. |
| AutoFilter | AutoFilter | Represents auto filter for the specified worksheet. |
| HasAutofilter | boolean | Indicates whether this worksheet has auto filter. |
| TransitionEvaluation | boolean | Indicates whether the Transition Formula Evaluation (Lotus compatibility) option is enabled. |
| TransitionEntry | boolean | Indicates whether the Transition Formula Entry (Lotus compatibility) option is enabled. |
| VisibilityType | int | Indicates the visible state for this sheet. The value of the property is VisibilityType integer constant. |
| IsVisible | boolean | Represents if the worksheet is visible. |
| SparklineGroups | SparklineGroupCollection | Gets the sparkline groups in the worksheet. |
| Charts | ChartCollection | Gets a Chart collection |
| Comments | CommentCollection | Gets the Comment collection. |
| Pictures | PictureCollection | Gets a Picture collection. |
| TextBoxes | TextBoxCollection | Gets a TextBox collection. |
| CheckBoxes | CheckBoxCollection | Gets a CheckBox collection. |
| OleObjects | OleObjectCollection | Represents a collection of OleObject in a worksheet. |
| Shapes | ShapeCollection | Returns all drawing shapes in this worksheet. |
| Slicers | SlicerCollection | Get the Slicer collection in the worksheet |
| Timelines | TimelineCollection | Get the Timeline collection in the worksheet |
| Index | int | Gets the index of sheet in the worksheet collection. |
| IsProtected | boolean | Indicates if the worksheet is protected. |
| Validations | ValidationCollection | Gets the data validation setting collection in the worksheet. |
| AllowEditRanges | ProtectedRangeCollection | Gets the allow edit range collection in the worksheet. |
| ErrorCheckOptions | ErrorCheckOptionCollection | Gets error check setting applied on certain ranges. |
| Outline | Outline | Gets the outline on this worksheet. |
| FirstVisibleRow | int | Represents first visible row index. |
| FirstVisibleColumn | int | Represents first visible column index. |
| Zoom | int | Represents the scaling factor in percentage. It should be between 10 and 400. Please set the view type first. |
| ViewType | int | Gets and sets the view type. The value of the property is ViewType integer constant. |
| IsPageBreakPreview | boolean | Indicates whether the specified worksheet is shown in normal view or page break preview. |
| IsRulerVisible | boolean | Indicates whether the ruler is visible. This property is only applied for page break preview. |
| TabColor | Color | Represents worksheet tab color. This feature is only supported in ExcelXP(Excel2002) and later versions. If you save fil |
| GridlineColor | Color | |
| CodeName | String | Gets worksheet code name. |
| BackgroundImage | byte[] | Gets and sets worksheet background image. |
| ConditionalFormattings | ConditionalFormattingCollection | Gets the ConditionalFormattings in the worksheet. |
| ActiveCell | String | Gets or sets the active cell in the worksheet. |
| CustomProperties | CustomPropertyCollection | Gets an object representing the identifier information associated with a worksheet. Worksheet.CustomProperties provide a |
| SmartTagSetting | SmartTagSetting | Gets all SmartTagCollection objects of the worksheet. |
| Scenarios | ScenarioCollection | Gets the collection of Scenario . |
| CellWatches | CellWatchCollection | Gets collection of cells on this worksheet being watched in the ‘watch window’. |
Methods
| Name | Description |
|---|---|
| protect | Protects worksheet. |
This method protects worksheet without password. It can protect worksheet in all versions of Excel | | unprotect | Unprotects worksheet.
This method unprotects worksheet which is protected without password. | | moveTo | Moves the sheet to another location in the spreadsheet. | | replace | Replaces all cells’ text with a new string. | | getSelectedRanges | Gets selected ranges of cells in the designer spreadsheet. | | getSelectedAreas | | | getPrintingPageBreaks | Gets automatic page breaks.
Each cell area represents a paper. | | toString | Returns a string represents the current Worksheet object. | | startAccessCache | Starts the session that uses caches to access the data in this worksheet.
After finishing the access to the data, close | | closeAccessCache | Closes the session that uses caches to access the data in this worksheet. | | convertFormulaReferenceStyle | Converts the formula reference style. | | calculateFormula | Calculates a formula. | | calculateArrayFormula | Calculates a formula as array formula. | | xmlMapQuery | Query cell areas that mapped/linked to the specific path of xml map. | | refreshPivotTables | Refreshes all the PivotTables in this Worksheet. | | dispose | Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. | | getPanes | Gets the window panes.
If the window is not split or frozen. | | freezePanes | Freezes panes at the specified cell in the worksheet.
Row index and column index cannot all be zero. Number of rows and | | getFreezedPanes | Gets the freeze panes. | | split | Splits window. | | unFreezePanes | Unfreezes panes in the worksheet. | | removeSplit | Removes split window. | | addPageBreaks | Adds page break. | | copy | Copies contents and formats from another worksheet. | | autoFitColumn | Autofits the column width.
This method autofits a row based on content in a range of cells within the row. | | autoFitColumns | Autofits all columns in this worksheet. | | autoFitRow | Autofits the row height.
This method autofits a row based on content in a range of cells within the row. | | autoFitRows | Autofits all rows in this worksheet. | | filter | | | getAdvancedFilter | Gets the settings of advanced filter. | | advancedFilter | Filters data using complex criteria. | | removeAutoFilter | Removes the auto filter of the worksheet. | | setVisible | Sets the visible options. | | selectRange | Selects a range. | | removeAllDrawingObjects | Removes all drawing objects in this worksheet. | | clearComments | Clears all comments in designer spreadsheet. | | getAllPictures | |
Worksheet.Protection property
Represents the various types of protection options available for a worksheet. Supports advanced protection options in ExcelXP and above version. This property can protect worksheet in all versions of Excel file and support advanced protection options in ExcelXP and above version.
Type: Protection
Worksheet.UniqueId property
Gets and sets the unique id, it is same as {15DB5C3C-A5A1-48AF-8F25-3D86AC232D4F}.
Type: String
Worksheet.Workbook property
Gets the workbook object which contains this sheet.
Type: Workbook
Worksheet.Cells property
Gets the Cells collection.
Type: Cells
Worksheet.QueryTables property
Gets QueryTableCollection in the worksheet.
Type: QueryTableCollection
Worksheet.Type property
Represents worksheet type. The value of the property is SheetType integer constant.
Type: int
Worksheet.Name property
Gets or sets the name of the worksheet. The max length of sheet name is 31. And you cannot assign same name(case insensitive) to two worksheets. For example, you cannot set “SheetName1” to the first worksheet and set “SHEETNAME1” to the second worksheet.
Type: String
Worksheet.ShowFormulas property
Indicates whether to show formulas or their results.
Type: boolean
Worksheet.ShowDataTypeIcons property
Type: boolean
Worksheet.IsGridlinesVisible property
Gets or sets a value indicating whether the gridlines are visible.Default is true.
Type: boolean
Worksheet.IsRowColumnHeadersVisible property
Gets or sets a value indicating whether the worksheet will display row and column headers. Default is true.
Type: boolean
Worksheet.PaneState property
Indicates whether the pane has horizontal or vertical splits, and whether those splits are frozen. The value of the property is PaneStateType integer constant.
Type: int
Worksheet.DisplayZeros property
True if zero values are displayed.
Type: boolean
Worksheet.DisplayRightToLeft property
Indicates if the specified worksheet is displayed from right to left instead of from left to right. Default is false.
Type: boolean
Worksheet.IsOutlineShown property
Indicates whether to show outline.
Type: boolean
Worksheet.IsSelected property
Indicates whether this worksheet is selected when the workbook is opened.
Type: boolean
Worksheet.PivotTables property
Gets all pivot tables in this worksheet.
Type: PivotTableCollection
Worksheet.ListObjects property
Gets all ListObjects in this worksheet.
Type: ListObjectCollection
Worksheet.TabId property
Specifies the internal identifier for the sheet.
Type: int
Worksheet.HorizontalPageBreaks property
Gets the HorizontalPageBreakCollection collection.
Type: HorizontalPageBreakCollection
Worksheet.VerticalPageBreaks property
Gets the VerticalPageBreakCollection collection.
Type: VerticalPageBreakCollection
Worksheet.Hyperlinks property
Gets the HyperlinkCollection collection.
Type: HyperlinkCollection
Worksheet.PageSetup property
Represents the page setup description in this sheet.
Type: PageSetup
Worksheet.AutoFilter property
Represents auto filter for the specified worksheet.
Type: AutoFilter
Worksheet.HasAutofilter property
Indicates whether this worksheet has auto filter.
Type: boolean
Worksheet.TransitionEvaluation property
Indicates whether the Transition Formula Evaluation (Lotus compatibility) option is enabled.
Type: boolean
Worksheet.TransitionEntry property
Indicates whether the Transition Formula Entry (Lotus compatibility) option is enabled.
Type: boolean
Worksheet.VisibilityType property
Indicates the visible state for this sheet. The value of the property is VisibilityType integer constant.
Type: int
Worksheet.IsVisible property
Represents if the worksheet is visible.
Type: boolean
Worksheet.SparklineGroups property
Gets the sparkline groups in the worksheet.
Type: SparklineGroupCollection
Worksheet.Charts property
Gets a Chart collection
Type: ChartCollection
Worksheet.Comments property
Gets the Comment collection.
Type: CommentCollection
Worksheet.Pictures property
Gets a Picture collection.
Type: PictureCollection
Worksheet.TextBoxes property
Gets a TextBox collection.
Type: TextBoxCollection
Worksheet.CheckBoxes property
Gets a CheckBox collection.
Type: CheckBoxCollection
Worksheet.OleObjects property
Represents a collection of OleObject in a worksheet.
Type: OleObjectCollection
Worksheet.Shapes property
Returns all drawing shapes in this worksheet.
Type: ShapeCollection
Worksheet.Slicers property
Get the Slicer collection in the worksheet
Type: SlicerCollection
Worksheet.Timelines property
Get the Timeline collection in the worksheet
Type: TimelineCollection
Worksheet.Index property
Gets the index of sheet in the worksheet collection.
Type: int
Worksheet.IsProtected property
Indicates if the worksheet is protected.
Type: boolean
Worksheet.Validations property
Gets the data validation setting collection in the worksheet.
Type: ValidationCollection
Worksheet.AllowEditRanges property
Gets the allow edit range collection in the worksheet.
Type: ProtectedRangeCollection
Worksheet.ErrorCheckOptions property
Gets error check setting applied on certain ranges.
Type: ErrorCheckOptionCollection
Worksheet.Outline property
Gets the outline on this worksheet.
Type: Outline
Worksheet.FirstVisibleRow property
Represents first visible row index.
Type: int
Worksheet.FirstVisibleColumn property
Represents first visible column index.
Type: int
Worksheet.Zoom property
Represents the scaling factor in percentage. It should be between 10 and 400. Please set the view type first.
Type: int
Worksheet.ViewType property
Gets and sets the view type. The value of the property is ViewType integer constant.
Type: int
Worksheet.IsPageBreakPreview property
Indicates whether the specified worksheet is shown in normal view or page break preview.
Type: boolean
Worksheet.IsRulerVisible property
Indicates whether the ruler is visible. This property is only applied for page break preview.
Type: boolean
Worksheet.TabColor property
Represents worksheet tab color. This feature is only supported in ExcelXP(Excel2002) and later versions. If you save file as Excel97 or Excel2000 format, it will be omitted.
Type: Color
Worksheet.GridlineColor property
Type: Color
Worksheet.CodeName property
Gets worksheet code name.
Type: String
Worksheet.BackgroundImage property
Gets and sets worksheet background image.
Type: byte[]
Worksheet.ConditionalFormattings property
Gets the ConditionalFormattings in the worksheet.
Type: ConditionalFormattingCollection
Worksheet.ActiveCell property
Gets or sets the active cell in the worksheet.
Type: String
Worksheet.CustomProperties property
Gets an object representing the identifier information associated with a worksheet. Worksheet.CustomProperties provide a preferred mechanism for storing arbitrary data. It supports legacy third-party document components, as well as those situations that have a stringent need for binary parts.
Type: CustomPropertyCollection
Worksheet.SmartTagSetting property
Gets all SmartTagCollection objects of the worksheet.
Type: SmartTagSetting
Worksheet.Scenarios property
Gets the collection of Scenario .
Type: ScenarioCollection
Worksheet.CellWatches property
Gets collection of cells on this worksheet being watched in the ‘watch window’.
Type: CellWatchCollection
protect(type) (1 of 2)
Protects worksheet.
This method protects worksheet without password. It can protect worksheet in all versions of Excel file.
| Parameter | Type | Description |
|---|---|---|
| type | int | A ProtectionType value. Protection type. |
protect(type, password, oldPassword) (2 of 2)
Protects worksheet.
This method can protect worksheet in all versions of Excel file.
| Parameter | Type | Description |
|---|---|---|
| type | int | A ProtectionType value. Protection type. |
| password | String | Password. |
| oldPassword | String | If the worksheet is already protected by a password, please supply the old password. Otherwise, you can set a null value or blank string to this parameter. |
Example:
# Instantiating a Workbook object
excel = Workbook("Book2.xlsx")
# Accessing the first worksheet in the Excel file
worksheet = excel.getWorksheets().get(0)
# Protecting the worksheet with a password
worksheet.protect(ProtectionType.ALL, "aspose", None)
# Saving the modified Excel file in default (that is Excel 20003) format
excel.save("Book1.xls")
unprotect() (1 of 2)
Unprotects worksheet.
This method unprotects worksheet which is protected without password.
unprotect(password) (2 of 2)
Unprotects worksheet.
If the worksheet is protected without a password, you can set a null value or blank string to password parameter.
| Parameter | Type | Description |
|---|---|---|
| password | String | Password |
moveTo(index)
Moves the sheet to another location in the spreadsheet.
| Parameter | Type | Description |
|---|---|---|
| index | int | Destination sheet index. |
replace(oldString, newString)
Replaces all cells’ text with a new string.
| Parameter | Type | Description |
|---|---|---|
| oldString | String | Old string value. |
| newString | String | New string value. |
getSelectedRanges()
Gets selected ranges of cells in the designer spreadsheet.
Returns: An java.util.ArrayList which contains selected ranges.
getSelectedAreas()
getPrintingPageBreaks(options)
Gets automatic page breaks.
Each cell area represents a paper.
| Parameter | Type | Description |
|---|---|---|
| options | ImageOrPrintOptions | The print options |
Returns: The automatic page breaks areas.
toString()
Returns a string represents the current Worksheet object.
startAccessCache(opts)
Starts the session that uses caches to access the data in this worksheet.
After finishing the access to the data, closeAccessCache(int) should be invoked with same options to clear all caches and recover normal access mode.
| Parameter | Type | Description |
|---|---|---|
| opts | int | A AccessCacheOptions value. options of data access |
closeAccessCache(opts)
Closes the session that uses caches to access the data in this worksheet.
| Parameter | Type | Description |
|---|---|---|
| opts | int | A AccessCacheOptions value. options of data access |
convertFormulaReferenceStyle(formula, toR1C1, baseCellRow, baseCellColumn)
Converts the formula reference style.
| Parameter | Type | Description |
|---|---|---|
| formula | String | The formula to be converted. |
| toR1C1 | boolean | Which reference style to convert the formula to. If the original formula is of A1 reference style, then this value should be true so the formula will be converted from A1 to R1C1 reference style; If the original formula is of R1C1 reference style, then this value should be false so the formula will be converted from R1C1 to A1 reference style; |
| baseCellRow | int | The row index of the base cell. |
| baseCellColumn | int | The column index of the base cell. |
Returns: The converted formula.
calculateFormula(formula) (1 of 4)
Calculates a formula.
| Parameter | Type | Description |
|---|---|---|
| formula | String | Formula to be calculated. |
Returns: Calculated formula result.
calculateFormula(formula, opts) (2 of 4)
Calculates a formula expression directly.
The formula will be calculated just like it has been set to cell A1. And the formula will be taken as normal formula. If you need the formula be calculated as an array formula and to get an array for the calculated result, please use calculateArrayFormula(java.lang.String, com.aspose.cells.CalculationOptions) instead.
| Parameter | Type | Description |
|---|---|---|
| formula | String | Formula to be calculated. |
| opts | CalculationOptions | Options for calculating formula |
Returns: Calculated result of given formula. The returned object may be of possible types of Cell.Value , or ReferredArea.
calculateFormula(formula, pOpts, cOpts, baseCellRow, baseCellColumn, calculationData) (3 of 4)
Calculates a formula expression directly.
The formula will be calculated just like it has been set to the specified base cell. And the formula will be taken as normal formula. If you need the formula be calculated as an array formula and to get an array for the calculated result, please use calculateArrayFormula(java.lang.String, com.aspose.cells.FormulaParseOptions, com.aspose.cells.CalculationOptions, int, int, int, int, com.aspose.cells.CalculationData) instead.
| Parameter | Type | Description |
|---|---|---|
| formula | String | Formula to be calculated. |
| pOpts | FormulaParseOptions | Options for parsing formula. |
| cOpts | CalculationOptions | Options for calculating formula. |
| baseCellRow | int | The row index of the base cell. |
| baseCellColumn | int | The column index of the base cell. |
| calculationData | CalculationData | The calculation data. It is used for the situation that user needs to calculate some static formulas when implementing custom calculation engine. For such kind of situation, user needs to specify it with the calculation data provided for #Error Cref: M:Aspose.Cells.AbstractCalculationEngine.Calculate(Aspose.Cells.CalculationData) . |
Returns: Calculated result of given formula. The returned object may be of possible types of Cell.Value , or ReferredArea.
calculateFormula(options, recursive) (4 of 4)
Calculates all formulas in this worksheet.
| Parameter | Type | Description |
|---|---|---|
| options | CalculationOptions | Options for calculation |
| recursive | boolean | True means if the worksheet’ cells depend on the cells of other worksheets, the dependent cells in other worksheets will be calculated too. False means all the formulas in the worksheet have been calculated and the values are right. |
calculateArrayFormula(formula, opts) (1 of 3)
Calculates a formula as array formula.
| Parameter | Type | Description |
|---|---|---|
| formula | String | Formula to be calculated. |
| opts | CalculationOptions | Options for calculating formula |
calculateArrayFormula(formula, opts, maxRowCount, maxColumnCount) (2 of 3)
Calculates a formula as array formula.
The formula will be taken as dynamic array formula to calculate the dimension and result. User specified maximum dimension is used for cases that the calculated result is large data set (for example, the calculated result may correspond to a whole row or column data) but user does not need so large an array according to business requirement or for performance consideration.
| Parameter | Type | Description |
|---|---|---|
| formula | String | Formula to be calculated. |
| opts | CalculationOptions | Options for calculating formula |
| maxRowCount | int | the maximum row count of resultant data. If it is non-positive or greater than the actual row count, then actual row count will be used. |
| maxColumnCount | int | the maximum column count of resultant data. If it is non-positive or greater than the actual row count, then actual column count will be used. |
Returns: Calculated formula result.
calculateArrayFormula(formula, pOpts, cOpts, baseCellRow, baseCellColumn, maxRowCount, maxColumnCount, calculationData) (3 of 3)
Calculates a formula as array formula.
The formula will be taken as dynamic array formula to calculate the dimension and result. User specified maximum dimension is used for cases that the calculated result is large data set (for example, the calculated result may correspond to a whole row or column data) but user does not need so large an array according to business requirement or for performance consideration.
| Parameter | Type | Description |
|---|---|---|
| formula | String | Formula to be calculated. |
| pOpts | FormulaParseOptions | Options for parsing formula |
| cOpts | CalculationOptions | Options for calculating formula |
| baseCellRow | int | The row index of the base cell. |
| baseCellColumn | int | The column index of the base cell. |
| maxRowCount | int | The maximum row count of resultant data. If it is non-positive or greater than the actual row count, then actual row count will be used. |
| maxColumnCount | int | The maximum column count of resultant data. If it is non-positive or greater than the actual row count, then actual column count will be used. |
| calculationData | CalculationData | The calculation data. It is used for the situation that user needs to calculate some static formulas when implementing custom calculation engine. For such kind of situation, user needs to specify it with the calculation data provided for #Error Cref: M:Aspose.Cells.AbstractCalculationEngine.Calculate(Aspose.Cells.CalculationData) . |
Returns: Calculated formula result.
xmlMapQuery(path, xmlMap)
Query cell areas that mapped/linked to the specific path of xml map.
| Parameter | Type | Description |
|---|---|---|
| path | String | xml element path |
| xmlMap | XmlMap | Specify an xml map if you want to query for the specific path within a specific map |
Returns: CellArea list that mapped/linked to the specific path of xml map, an empty list is returned if nothing is mapped/linked.
refreshPivotTables() (1 of 2)
Refreshes all the PivotTables in this Worksheet.
refreshPivotTables(option) (2 of 2)
Refreshes all the PivotTables in this Worksheet.
| Parameter | Type | Description |
|---|---|---|
| option | PivotTableRefreshOption | The option for refreshing data source of pivot table. |
dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
getPanes()
Gets the window panes.
If the window is not split or frozen.
freezePanes(row, column, freezedRows, freezedColumns) (1 of 2)
Freezes panes at the specified cell in the worksheet.
Row index and column index cannot all be zero. Number of rows and number of columns also cannot all be zero. The first two parameters specify the froze position and the last two parameters specify the area frozen on the left top pane.
| Parameter | Type | Description |
|---|---|---|
| row | int | Row index. |
| column | int | Column index. |
| freezedRows | int | Number of visible rows in top pane, no more than row index. |
| freezedColumns | int | Number of visible columns in left pane, no more than column index. |
freezePanes(cellName, freezedRows, freezedColumns) (2 of 2)
Freezes panes at the specified cell in the worksheet.
Row index and column index cannot all be zero. Number of rows and number of columns also cannot all be zero.
| Parameter | Type | Description |
|---|---|---|
| cellName | String | Cell name. |
| freezedRows | int | Number of visible rows in top pane, no more than row index. |
| freezedColumns | int | Number of visible columns in left pane, no more than column index. |
getFreezedPanes()
Gets the freeze panes.
Returns: Return null means the worksheet is not frozen 0:Row index;1:column;2:freezedRows;3:freezedRows
split()
Splits window.
unFreezePanes()
Unfreezes panes in the worksheet.
removeSplit()
Removes split window.
addPageBreaks(cellName)
Adds page break.
| Parameter | Type | Description |
|---|---|---|
| cellName | String |
copy(sourceSheet) (1 of 2)
Copies contents and formats from another worksheet.
| Parameter | Type | Description |
|---|---|---|
| sourceSheet | Worksheet | Source worksheet. |
copy(sourceSheet, copyOptions) (2 of 2)
Copies contents and formats from another worksheet.
You can copy data from another worksheet in the same file or another file. However, this method does not support to copy drawing objects, such as comments, images and charts.
| Parameter | Type | Description |
|---|---|---|
| sourceSheet | Worksheet | Source worksheet. |
| copyOptions | CopyOptions |
autoFitColumn(columnIndex, firstRow, lastRow) (1 of 2)
Autofits the column width.
This method autofits a row based on content in a range of cells within the row.
| Parameter | Type | Description |
|---|---|---|
| columnIndex | int | Column index. |
| firstRow | int | First row index. |
| lastRow | int | Last row index. |
autoFitColumn(columnIndex) (2 of 2)
Autofits the column width.
AutoFitColumn is an imprecise function.
| Parameter | Type | Description |
|---|---|---|
| columnIndex | int | Column index. |
autoFitColumns() (1 of 6)
Autofits all columns in this worksheet.
autoFitColumns(options) (2 of 6)
Autofits all columns in this worksheet.
| Parameter | Type | Description |
|---|---|---|
| options | AutoFitterOptions | The auto fitting options |
autoFitColumns(firstColumn, lastColumn) (3 of 6)
Autofits the columns width.
AutoFitColumn is an imprecise function.
| Parameter | Type | Description |
|---|---|---|
| firstColumn | int | First column index. |
| lastColumn | int | Last column index. |
autoFitColumns(firstColumn, lastColumn, options) (4 of 6)
Autofits the columns width.
AutoFitColumn is an imprecise function.
| Parameter | Type | Description |
|---|---|---|
| firstColumn | int | First column index. |
| lastColumn | int | Last column index. |
| options | AutoFitterOptions | The auto fitting options |
autoFitColumns(firstRow, firstColumn, lastRow, lastColumn) (5 of 6)
Autofits the columns width.
AutoFitColumn is an imprecise function.
| Parameter | Type | Description |
|---|---|---|
| firstRow | int | First row index. |
| firstColumn | int | First column index. |
| lastRow | int | Last row index. |
| lastColumn | int | Last column index. |
autoFitColumns(firstRow, firstColumn, lastRow, lastColumn, options) (6 of 6)
Autofits the columns width.
AutoFitColumn is an imprecise function.
| Parameter | Type | Description |
|---|---|---|
| firstRow | int | First row index. |
| firstColumn | int | First column index. |
| lastRow | int | Last row index. |
| lastColumn | int | Last column index. |
| options | AutoFitterOptions | The auto fitting options |
autoFitRow(rowIndex, firstColumn, lastColumn) (1 of 4)
Autofits the row height.
This method autofits a row based on content in a range of cells within the row.
| Parameter | Type | Description |
|---|---|---|
| rowIndex | int | Row index. |
| firstColumn | int | First column index. |
| lastColumn | int | Last column index. |
autoFitRow(rowIndex, firstColumn, lastColumn, options) (2 of 4)
Autofits the row height.
This method autofits a row based on content in a range of cells within the row.
| Parameter | Type | Description |
|---|---|---|
| rowIndex | int | Row index. |
| firstColumn | int | First column index. |
| lastColumn | int | Last column index. |
| options | AutoFitterOptions | The auto fitter options |
autoFitRow(startRow, endRow, startColumn, endColumn) (3 of 4)
Autofits row height in a rectangle range.
| Parameter | Type | Description |
|---|---|---|
| startRow | int | Start row index. |
| endRow | int | End row index. |
| startColumn | int | Start column index. |
| endColumn | int | End column index. |
autoFitRow(rowIndex) (4 of 4)
Autofits the row height.
AutoFitRow is an imprecise function.
| Parameter | Type | Description |
|---|---|---|
| rowIndex | int | Row index. |
autoFitRows() (1 of 5)
Autofits all rows in this worksheet.
autoFitRows(onlyAuto) (2 of 5)
Autofits all rows in this worksheet.
| Parameter | Type | Description |
|---|---|---|
| onlyAuto | boolean | True,only autofits the row height when row height is not customed. |
autoFitRows(options) (3 of 5)
Autofits all rows in this worksheet.
| Parameter | Type | Description |
|---|---|---|
| options | AutoFitterOptions | The auto fitter options |
autoFitRows(startRow, endRow) (4 of 5)
Autofits row height in a range.
| Parameter | Type | Description |
|---|---|---|
| startRow | int | Start row index. |
| endRow | int | End row index. |
autoFitRows(startRow, endRow, options) (5 of 5)
Autofits row height in a range.
| Parameter | Type | Description |
|---|---|---|
| startRow | int | Start row index. |
| endRow | int | End row index. |
| options | AutoFitterOptions | The options of auto fitter. |
filter(ca)
getAdvancedFilter()
Gets the settings of advanced filter.
advancedFilter(isFilter, listRange, criteriaRange, copyTo, uniqueRecordOnly)
Filters data using complex criteria.
| Parameter | Type | Description |
|---|---|---|
| isFilter | boolean | Indicates whether filtering the list in place. |
| listRange | String | The list range. |
| criteriaRange | String | The criteria range. |
| copyTo | String | The range where copying data to. |
| uniqueRecordOnly | boolean | Only displaying or copying unique rows. |
removeAutoFilter()
Removes the auto filter of the worksheet.
setVisible(isVisible, ignoreError)
Sets the visible options.
| Parameter | Type | Description |
|---|---|---|
| isVisible | boolean | Whether the worksheet is visible |
| ignoreError | boolean | Whether to ignore error if this option is not valid. |
selectRange(startRow, startColumn, totalRows, totalColumns, removeOthers)
Selects a range.
| Parameter | Type | Description |
|---|---|---|
| startRow | int | The start row. |
| startColumn | int | The start column |
| totalRows | int | The number of rows. |
| totalColumns | int | The number of columns |
| removeOthers | boolean | True means removing other selected range and only select this range. |
removeAllDrawingObjects()
Removes all drawing objects in this worksheet.
clearComments()
Clears all comments in designer spreadsheet.