Worksheet

Overview

Worksheet is a type in Aspose.Cells FOSS for Go.

Worksheet represents a single sheet within a workbook.

Available methods include: AddDataValidation, AddPicture, AddTable, Cells, FromCSV, GetTable, RemoveDataValidation, ToCSV. All public members are accessible to any Go application after installing the Aspose.Cells FOSS for Go package. Properties: DataValidations, Index, Name, Pictures, Tables.

Properties

NameTypeAccessDescription
NamestringRead/WriteGets the name.
IndexintRead/WriteGets the index.
DataValidations[]*DataValidationRead/WriteGets the data validations.
Tables[]*TableRead/WriteGets the tables.
Pictures[]*PictureRead/WriteGets the pictures.

Methods

SignatureDescription
ToCSV(delimiter: rune)([][]string, error)ToCSV converts the worksheet’s cells into a 2D string slice suitable for writing with encoding/csv.
FromCSV(data: [][]string, delimiter: rune)errorFromCSV populates the worksheet with data from a 2D string slice.
AddDataValidation(ref: string, dv: *DataValidation)errorAddDataValidation appends a data-validation rule to the worksheet.
RemoveDataValidation(ref: string)errorRemoveDataValidation removes the first data-validation rule whose Ref exactly matches the given ref string.
AddPicture(pic: *Picture)errorAddPicture attaches pic to the worksheet, assigns it a unique name, and marks the workbook as modified.
AddTable(rangeRef: string)*TableAddTable creates a new Table covering the given range, assigns it a unique auto-generated name (“Table1”, “Table2”, …), appends it to the worksheet, and returns it for further configuration.
GetTable(name: string)*TableGetTable returns the Table with the given name, or nil when no match is found.
Cells()*CellsCells returns the Cells collection for this worksheet, enabling cell-level read and write operations via A1-style references.

See Also