TX Sheet Control

WorkbookCommand Constructor

Constructor
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

Syntax

public WorkbookCommand(string Method, object?[] Args = null)

Parameters

ParameterTypeOptionalDescription
MethodstringNoValue matching Method's declared type and the owning object's validation rules.
Argsobject?[]YesValue matching Args's declared type and the owning object's validation rules.

Return Value

WorkbookCommand.

Examples

Create a working document workflow using WorkbookCommand. Return the generated document or application data to the caller.

using TXTextControl.TXSheetControl.Server;

async Task<byte[]> BuildWorkbookCommandConstructorAsync(ServerSheetControl control)
{
    await control.BatchAsync([new WorkbookCommand("setCell", ["A1", "October invoice"]), new WorkbookCommand("setCell", ["B8", 120]), new WorkbookCommand("setCell", ["B9", 80]), new WorkbookCommand("setCell", ["B10", "=SUM(B8:B9)"])]);

    var sheet = await control.Workbook.Sheets.AtAsync(0);
    await sheet.Cell("A1").FormatAsync(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