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
| Name | Type | Access | Description |
|---|---|---|---|
Name | string | Read/Write | Gets the name. |
Index | int | Read/Write | Gets the index. |
DataValidations | []*DataValidation | Read/Write | Gets the data validations. |
Tables | []*Table | Read/Write | Gets the tables. |
Pictures | []*Picture | Read/Write | Gets the pictures. |
Methods
| Signature | Description |
|---|---|
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) → error | FromCSV populates the worksheet with data from a 2D string slice. |
AddDataValidation(ref: string, dv: *DataValidation) → error | AddDataValidation appends a data-validation rule to the worksheet. |
RemoveDataValidation(ref: string) → error | RemoveDataValidation removes the first data-validation rule whose Ref exactly matches the given ref string. |
AddPicture(pic: *Picture) → error | AddPicture attaches pic to the worksheet, assigns it a unique name, and marks the workbook as modified. |
AddTable(rangeRef: string) → *Table | AddTable 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) → *Table | GetTable returns the Table with the given name, or nil when no match is found. |
Cells() → *Cells | Cells returns the Cells collection for this worksheet, enabling cell-level read and write operations via A1-style references. |