TX Sheet Control

BlazorSheetControl.MergeAsync Method

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

Merges application data into this document through the shared engine.

Syntax

public Task<JsonElement> MergeAsync(object data, object? options = null, CancellationToken cancellationToken = default)

Parameters

NameTypeDescription
dataobjectSerializable application data for the configured merge bindings.
optionsobject?Optional operation settings.
cancellationTokenCancellationTokenCancellation before starting the operation, with cooperative cancellation for supported file work.

Return Value

Task<JsonElement>. The awaited operation result, detached from browser transport.

Exceptions

API failures throw ServerSheetControlException with a code. A canceled operation throws OperationCanceledException. Browser filesystem overloads and synchronous C# cell renderers throw PlatformNotSupportedException.

Examples

The control variable is the host received by Ready. File examples use caller-provided xlsxBytes.

var sheet = await control.Workbook.Sheets.AtAsync(0);
await sheet.Cell("F2").SetValueAsync("Customer");
await control.Workbook.SetMailMergeAsync(new
{
    version = 1, bindings = new[] { new { sheetId = sheet.Id, cell = "F2", path = "customer" } },
    repeatBlocks = Array.Empty<object>()
});
await control.MergeAsync(new { customer = "Fabrikam" });

Remarks

Await asynchronous operations. Replacement workbook loads invalidate earlier worksheet, cell and range handles. Browser callbacks report completed notifications.

See Also