TX Sheet Control

DocumentObject.Command Method

Method
Namespace
TXTextControl.TXSheetControl.Server
Package
TXTextControl.TXSheetControl.Server as TXTextControl.TXSheetControl.Api.dll from the private NuGet feed or the supplied NuGet folder
Also in
TXTextControl.TXSheetControl.Blazor as TXTextControl.TXSheetControl.Api.dll

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

Syntax

public ObjectCommand Command(string method, object?[] args)

Parameters

ParameterTypeOptionalDescription
methodstringNoOperation-specific input; see this type's units and ownership contract.
argsobject?[]NoOperation-specific input; see this type's units and ownership contract.

Return Value

ObjectCommand. The operation result, returned asynchronously.

Examples

Create commands from a document-owned cell and apply them together through Workbook.BatchAsync.

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);
}

Remarks

Use the member with an instance or settings object from the documented package. Await task-returning operations. Document-bound handles must be resolved again after loading or deleting their owner.

See Also