TX Sheet Control

Worksheet Class

Class
Namespace
TXTextControl.TXSheetControl.Server
Package
TXTextControl.TXSheetControl.Server from the private NuGet feed or the supplied NuGet folder
Assembly
TXTextControl.TXSheetControl.Api.dll
Install
dotnet add package TXTextControl.TXSheetControl.Server .NET 10 and later.
Also in
TXTextControl.TXSheetControl.Blazor as TXTextControl.TXSheetControl.Api.dll
Inherits
  1. DocumentObject
  2. Worksheet

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

Syntax

public class Worksheet

Members

Properties

PropertyDescription
Charts
Columns
Drawings
Id
Names
PivotTablesThe destination-worksheet-scoped collection of operational pivot reports.
Print
Protection
Rows
Tables
Validation
Viewport

Methods

MethodDescription
AddSparklinesAsyncAdds sparklines from A1 dataRange/locationRange options in one undoable sheet-scoped transaction.
CellCreates or updates a document-bound handle or queued operation; the owning workbook retains validation authority.
ClearSparklinesAsyncRemoves sparklines in an A1 destination range, or all when omitted; source cells remain intact.
DuplicateAsyncDuplicates cells, formatting and objects with distinct table names and identities.
GetNameAsyncPerforms an operation on this document without activating another worksheet.
GetSparklineGroupsAsyncReads detached sparkline group definitions on this sheet without activating it.
GetTabColorAsyncReads the persisted sRGB tab color, or null for the default tab appearance.
MoveAsyncMoves this worksheet within its group; index is zero-based.
RangeCreates or updates a document-bound handle or queued operation; the owning workbook retains validation authority.
RemoveAsyncPerforms an operation on this document without activating another worksheet.
RenameAsyncPerforms an operation on this document without activating another worksheet.
SetTabColorAsyncSets the worksheet tab color in one undoable operation without changing cell or print formatting.
UpdateSparklineGroupAsyncUpdates 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.

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