# Worksheet Class

> Worksheet class in the TX Sheet Control .NET API: A handle bound to a worksheet ID and opaque document generation. Includes the syntax and a C# example.

- **Product:** TX Sheet Control
- **Section:** Documentation
- **Kind:** Class
- **Namespace:** `TXTextControl.TXSheetControl.Server`
- **Package:** `TXTextControl.TXSheetControl.Server` (assembly `TXTextControl.TXSheetControl.Api.dll`, from the private NuGet feed or the supplied NuGet folder)
- **Package:** `TXTextControl.TXSheetControl.Blazor` (assembly `TXTextControl.TXSheetControl.Api.dll`, from the private NuGet feed or the supplied NuGet folder)
- **Inherits:** `TXTextControl.TXSheetControl.Server.DocumentObject`
- **Path:** TX Sheet Control > API Reference > .NET API > TXTextControl.TXSheetControl.Server > Worksheet Class
- **1516 words**
- **Web URL:** https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/worksheet/
- **LLMs URL:** https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/worksheet/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/worksheet/llms-full.txt

---

A handle bound to a worksheet ID and opaque document generation.

### Syntax

```csharp
public class Worksheet
```

### Members

#### Properties

| Property | Description |
|---|---|
| [Charts](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/worksheet/charts-property/llms-full.txt) |  |
| [Columns](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/worksheet/columns-property/llms-full.txt) |  |
| [Drawings](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/worksheet/drawings-property/llms-full.txt) |  |
| [Id](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/worksheet/id-property/llms-full.txt) |  |
| [Names](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/worksheet/names-property/llms-full.txt) |  |
| [PivotTables](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/worksheet/pivottables-property/llms-full.txt) | The destination-worksheet-scoped collection of operational pivot reports. |
| [Print](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/worksheet/print-property/llms-full.txt) |  |
| [Protection](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/worksheet/protection-property/llms-full.txt) |  |
| [Rows](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/worksheet/rows-property/llms-full.txt) |  |
| [Tables](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/worksheet/tables-property/llms-full.txt) |  |
| [Validation](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/worksheet/validation-property/llms-full.txt) |  |
| [Viewport](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/worksheet/viewport-property/llms-full.txt) |  |

#### Methods

| Method | Description |
|---|---|
| [AddSparklinesAsync](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/worksheet/addsparklinesasync-method/llms-full.txt) | Adds sparklines from A1 dataRange/locationRange options in one undoable sheet-scoped transaction. |
| [Cell](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/worksheet/cell-method/llms-full.txt) | Creates or updates a document-bound handle or queued operation; the owning workbook retains validation authority. |
| [ClearSparklinesAsync](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/worksheet/clearsparklinesasync-method/llms-full.txt) | Removes sparklines in an A1 destination range, or all when omitted; source cells remain intact. |
| [DuplicateAsync](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/worksheet/duplicateasync-method/llms-full.txt) | Duplicates cells, formatting and objects with distinct table names and identities. |
| [GetNameAsync](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/worksheet/getnameasync-method/llms-full.txt) | Performs an operation on this document without activating another worksheet. |
| [GetSparklineGroupsAsync](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/worksheet/getsparklinegroupsasync-method/llms-full.txt) | Reads detached sparkline group definitions on this sheet without activating it. |
| [GetTabColorAsync](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/worksheet/gettabcolorasync-method/llms-full.txt) | Reads the persisted sRGB tab color, or null for the default tab appearance. |
| [MoveAsync](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/worksheet/moveasync-method/llms-full.txt) | Moves this worksheet within its group; index is zero-based. |
| [Range](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/worksheet/range-method/llms-full.txt) | Creates or updates a document-bound handle or queued operation; the owning workbook retains validation authority. |
| [RemoveAsync](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/worksheet/removeasync-method/llms-full.txt) | Performs an operation on this document without activating another worksheet. |
| [RenameAsync](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/worksheet/renameasync-method/llms-full.txt) | Performs an operation on this document without activating another worksheet. |
| [SetTabColorAsync](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/worksheet/settabcolorasync-method/llms-full.txt) | Sets the worksheet tab color in one undoable operation without changing cell or print formatting. |
| [UpdateSparklineGroupAsync](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/worksheet/updatesparklinegroupasync-method/llms-full.txt) | Updates a group by stable ID; invalid patches or stale handles reject before mutation. |

### Examples

Build a small report using this document API and return its PDF bytes. Pass a live control with a fresh workbook; the caller owns its lifetime.

```csharp
using TXTextControl.TXSheetControl.Server;

async Task<byte[]> CreateWorksheetReportAsync(ServerSheetControl control)
{
    var book = control.Workbook;
    var sheet = await book.Sheets.AtAsync(0);
    await sheet.Cell("B8").SetValueAsync(120);
    await sheet.Cell("B9").SetValueAsync(80);
    await sheet.Cell("B10").SetFormulaAsync("=SUM(B8:B9)");

    var worksheet = sheet;
    return await control.SaveAsync(StreamType.PDF);
}
```

### See Also

- [TXTextControl.TXSheetControl.Server Namespace](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/llms-full.txt)
- [Workbooks and Worksheets](https://docs.textcontrol.com/tx-sheet-control/spreadsheets/workbooks/llms-full.txt)

---

## In This Section

- [Worksheet.AddSparklinesAsync Method](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/worksheet/addsparklinesasync-method/llms-full.txt): Worksheet.AddSparklinesAsync method in the .NET API: Adds sparklines from A1 dataRange/locationRange options in one undoable sheet-scoped transaction.
- [Worksheet.Cell Method](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/worksheet/cell-method/llms-full.txt): Worksheet.Cell method in the TX Sheet Control .NET API: Creates or updates a document-bound handle or queued operation. Includes the syntax and a C# example.
- [Worksheet.Charts Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/worksheet/charts-property/llms-full.txt): Worksheet.Charts property in the TX Sheet Control .NET API, with its syntax, its type ChartCollection, a C# example and remarks on awaiting tasks and handles.
- [Worksheet.ClearSparklinesAsync Method](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/worksheet/clearsparklinesasync-method/llms-full.txt): Worksheet.ClearSparklinesAsync method in the TX Sheet Control .NET API: Removes sparklines in an A1 destination range, or all when omitted.
- [Worksheet.Columns Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/worksheet/columns-property/llms-full.txt): Worksheet.Columns property in the TX Sheet Control .NET API, with its syntax, its type DimensionCollection and a C# example.
- [Worksheet.Drawings Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/worksheet/drawings-property/llms-full.txt): Worksheet.Drawings property in the TX Sheet Control .NET API, with its syntax, its type DrawingCollection and a C# example.
- [Worksheet.DuplicateAsync Method](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/worksheet/duplicateasync-method/llms-full.txt): Worksheet.DuplicateAsync method in the TX Sheet Control .NET API: Duplicates cells, formatting and objects with distinct table names and identities.
- [Worksheet.GetNameAsync Method](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/worksheet/getnameasync-method/llms-full.txt): Worksheet.GetNameAsync method in the TX Sheet Control .NET API: Performs an operation on this document without activating another worksheet.
- [Worksheet.GetSparklineGroupsAsync Method](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/worksheet/getsparklinegroupsasync-method/llms-full.txt): Worksheet.GetSparklineGroupsAsync method in the TX Sheet Control .NET API: Reads detached sparkline group definitions on this sheet without activating it.
- [Worksheet.GetTabColorAsync Method](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/worksheet/gettabcolorasync-method/llms-full.txt): Worksheet.GetTabColorAsync method in the TX Sheet Control .NET API: Reads the persisted sRGB tab color, or null for the default tab appearance.
- [Worksheet.Id Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/worksheet/id-property/llms-full.txt): Worksheet.Id property in the TX Sheet Control .NET API, with its syntax, its type string, a C# example and remarks on awaiting tasks and handles.
- [Worksheet.MoveAsync Method](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/worksheet/moveasync-method/llms-full.txt): Worksheet.MoveAsync method in the TX Sheet Control .NET API: Moves this worksheet within its group; index is zero-based.
- [Worksheet.Names Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/worksheet/names-property/llms-full.txt): Worksheet.Names property in the TX Sheet Control .NET API, with its syntax, its type NameCollection, a C# example and remarks on awaiting tasks and handles.
- [Worksheet.PivotTables Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/worksheet/pivottables-property/llms-full.txt): Worksheet.PivotTables property in the TX Sheet Control .NET API: The destination-worksheet-scoped collection of operational pivot reports.
- [Worksheet.Print Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/worksheet/print-property/llms-full.txt): Worksheet.Print property in the TX Sheet Control .NET API, with its syntax, its type SheetPrint, a C# example and remarks on awaiting tasks and handles.
- [Worksheet.Protection Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/worksheet/protection-property/llms-full.txt): Worksheet.Protection property in the TX Sheet Control .NET API, with its syntax, its type Protection, a C# example and remarks on awaiting tasks and handles.
- [Worksheet.Range Method](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/worksheet/range-method/llms-full.txt): Worksheet.Range method in the TX Sheet Control .NET API: Creates or updates a document-bound handle or queued operation.
- [Worksheet.RemoveAsync Method](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/worksheet/removeasync-method/llms-full.txt): Worksheet.RemoveAsync method in the TX Sheet Control .NET API: Performs an operation on this document without activating another worksheet.
- [Worksheet.RenameAsync Method](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/worksheet/renameasync-method/llms-full.txt): Worksheet.RenameAsync method in the TX Sheet Control .NET API: Performs an operation on this document without activating another worksheet.
- [Worksheet.Rows Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/worksheet/rows-property/llms-full.txt): Worksheet.Rows property in the TX Sheet Control .NET API, with its syntax, its type DimensionCollection and a C# example.
- [Worksheet.SetTabColorAsync Method](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/worksheet/settabcolorasync-method/llms-full.txt): Worksheet.SetTabColorAsync method in the .NET API: Sets the worksheet tab color in one undoable operation without changing cell or print formatting.
- [Worksheet.Tables Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/worksheet/tables-property/llms-full.txt): Worksheet.Tables property in the TX Sheet Control .NET API, with its syntax, its type TableCollection, a C# example and remarks on awaiting tasks and handles.
- [Worksheet.UpdateSparklineGroupAsync Method](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/worksheet/updatesparklinegroupasync-method/llms-full.txt): Worksheet.UpdateSparklineGroupAsync method in the TX Sheet Control .NET API: Updates a group by stable ID. Includes the syntax and a C# example.
- [Worksheet.Validation Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/worksheet/validation-property/llms-full.txt): Worksheet.Validation property in the TX Sheet Control .NET API, with its syntax, its type Validation, a C# example and remarks on awaiting tasks and handles.
- [Worksheet.Viewport Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/worksheet/viewport-property/llms-full.txt): Worksheet.Viewport property in the TX Sheet Control .NET API, with its syntax, its type SheetView, a C# example and remarks on awaiting tasks and handles.

---

## Nearby

- **Previous:** [WorkbookEvents.ValidationFailed Event](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/workbookevents/validationfailed-event/llms-full.txt)
- **Next:** [Worksheet.AddSparklinesAsync Method](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/worksheet/addsparklinesasync-method/llms-full.txt)
