TX Sheet Control

DocumentObject 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
Derived
Analytics, Calculation, Chart, ChartCollection, Comments, Dashboard, DashboardCollection, Dimension, DimensionCollection, Drawing, DrawingCollection, DrawingGroup, NameCollection, PivotTable, PivotTableCollection, Protection, Range, Search, SheetCollection, SheetPrint, SheetView, Table, TableCollection, Validation, Worksheet

Base for sheet-bound handles. Methods perform async I/O; creating cell/range handles performs none.

Syntax

public abstract class DocumentObject

Members

Methods

MethodDescription
CommandCreates or updates a document-bound handle or queued operation; the owning workbook retains validation authority.

Examples

Use a worksheet cell through its DocumentObject base to queue text and formatting changes in one atomic transaction, then export the visible result.

using TXTextControl.TXSheetControl.Server;

async Task<byte[]> CreateInvoiceHeadingAsync(ServerSheetControl control)
{
    var book = control.Workbook;
    var sheet = await book.Sheets.AtAsync(0);
    DocumentObject heading = sheet.Cell("A1");
    await book.BatchAsync(batch =>
    {
        batch.Add(heading.Command("setText", "October invoice"));
        batch.Add(heading.Command("format", new { fontFamily = "Liberation Sans", fontSize = 16, bold = true, textColor = "#ffffff", fillColor = "#163b63" }));
    });

    return await control.SaveAsync(StreamType.PDF);
}

See Also