DocumentObject Class
- Namespace
TXTextControl.TXSheetControl. Server
- Package
TXTextControl.from the private NuGet feed or the supplied NuGet folderTXSheetControl. Server
- Assembly
TXTextControl.TXSheetControl. Api. dll
- Install
dotnet add package TXTextControl..NET 10 and later.TXSheetControl. Server
- Also in
TXTextControl.asTXSheetControl. Blazor TXTextControl.TXSheetControl. Api. dll
- Derived
- Analytics, Calculation, Chart, Chart
Collection , Comments, Dashboard, DashboardCollection , Dimension, DimensionCollection , Drawing, DrawingCollection , DrawingGroup , NameCollection , PivotTable , PivotTable , Protection, Range, Search, SheetCollection Collection , 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
| Method | Description |
|---|---|
| Command | Creates 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);
}