Worksheet

Overview

Worksheet is a class in Aspose.Cells FOSS for Typescript.

This class provides 24 methods for working with Worksheet objects in Typescript programs. Available methods include: addComment, addConditionalFormat, addDataValidation, addHyperlink, addImage, addShape, constructor, getCell, getCell2, getCellByRef, getColumnWidth, getRowHeight, and 12 additional methods. All public members are accessible to any Typescript application after installing the Aspose.Cells FOSS for Typescript package. Properties: autoFilter, cell, cells, charts, comments, conditionalFormats, and 17 more.

Description

Worksheet is a class in the Aspose.Cells FOSS library for TypeScript that exposes 23 methods and 23 properties for programmatic use.

Core capabilities include: : string; : hyperlink; : number. These operations enable developers to integrate worksheet functionality directly into TypeScript applications.

The class also provides the cell property (gets the cell), the link property (gets the link), the startRow property (gets the start row).

Instances are created through a single constructor that initializes the object with default values.

Properties

NameTypeAccessDescription
cell: stringReadGets the cell.
link: HyperlinkReadGets the link.
startRow: numberReadGets the start row.
startCol: numberReadGets the start col.
endRow: numberReadGets the end row.
endCol: numberReadGets the end col.
range: stringReadGets the range.
rules: ConditionalFormatRule[]ReadGets the rules.
namestringRead/WriteGets the name.
indexnumberReadGets the index.
cells``ReadGets the cells.
valueCellValue | undefinedRead/WriteGets the value.
dataValidations``ReadGets the data validations.
comments``ReadGets the comments.
hyperlinks``ReadGets the hyperlinks.
autoFilter``ReadGets the auto filter.
conditionalFormats``ReadGets the conditional formats.
mergedCells``ReadGets the merged cells.
defaultColumnWidthnumber | undefinedRead/WriteGets the default column width.
defaultRowHeightnumber | undefinedRead/WriteGets the default row height.
shapesShapeInfo[]ReadGets the shapes.
chartsChartCollectionReadGets the charts.
imagesImageInfo[]ReadGets the images.

Methods

SignatureDescription
constructor(name: string, index: number)Creates a new Worksheet with the specified name and zero-based index.
getCell(row: number, col: number)Cell | undefinedReturns the Cell at the given zero-based row and column indices, or undefined if the cell does not exist.
getCellByRef(ref: string)Cell | undefinedReturns the Cell at the given A1-style reference string, or undefined if the cell does not exist.
getCell2(key: string)CellReturns or creates the Cell identified by the given key string.
putValue(key: string, value: CellValue)CellWrites a value to the cell identified by an A1-style reference and returns the updated Cell instance.
addDataValidation(validation: DataValidation, range: string)Attaches data-validation rules to the specified cell range.
addComment(comment: Comment)Adds a comment to the worksheet.
addHyperlink(cellRef: string, hyperlink: Hyperlink)Adds a hyperlink to the cell at the specified A1-style reference.
setAutoFilter(range: string)Sets the auto filter value.
removeAutoFilter()Removes the auto filter from the worksheet.
addConditionalFormat(range: string, rules: ConditionalFormatRule[])Applies conditional formatting rules to the specified cell range.
mergeCells(range: string)Merges the cells in the specified range into a single cell.
unmergeCells(range: string)Splits a previously merged range back into individual cells.
setColumnWidth(column: number, width: number)Sets the column width value.
getColumnWidth(column: number)number | undefinedReturns the width of the specified zero-based column index.
setRowHeight(row: number, height: number)Sets the row height value.
getRowHeight(row: number)number | undefinedReturns the height of the specified zero-based row index.
setRowHidden(row: number, hidden: boolean)Sets the row hidden value.
isRowHidden(row: number)booleanReturns true if the specified row is hidden, false otherwise.
setCellStyle(cellRef: string, style: any)Sets the cell style value.
addShape(shape: ShapeInfo)Adds a shape to the worksheet.
addImage(image: ImageInfo)Adds an image to the worksheet.
toXml(drawingIndex: number)stringSerializes the worksheet drawing to an XML string for the specified drawing index.
getXml(drawingIndex: number)stringReturns the XML string for the drawing at the specified index.

See Also