TX Sheet Control

LoadOptions 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
TabularLoadOptions

Reusable format-specific load settings, with cancellation supplied separately per operation.

Syntax

public class LoadOptions

Members

Constructors

ConstructorDescription
Constructor

Properties

Examples

Load an application-supplied workbook with these conversion settings, edit and format its heading, and return a PDF of the result.

using TXTextControl.TXSheetControl.Server;

async Task<byte[]> CreateConfiguredLoadOptionsReportAsync(ServerSheetControl control, byte[] originalDocument)
{
    var settings = new LoadOptions();
    await control.LoadAsync(originalDocument, StreamType.SpreadsheetML, settings);

    var sheet = await control.Workbook.Sheets.AtAsync(0);
    await sheet.Cell("A1").SetTextAsync("Reviewed invoice");
    await sheet.Cell("A1").FormatAsync(new { fontFamily = "Liberation Sans", fontSize = 16, bold = true, textColor = "#ffffff", fillColor = "#163b63" });
    return await control.SaveAsync(StreamType.PDF, new SaveOptions { OmitDashboards = true });
}

See Also