TX Sheet Control

TabularLoadOptions 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
Inherits
  1. LoadOptions
  2. TabularLoadOptions
Derived
CsvLoadOptions

Limits and worksheet settings for UTF-8 tabular imports. A successful import replaces the workbook.

Syntax

public class TabularLoadOptions

Members

Constructors

ConstructorDescription
Constructor

Properties

PropertyDescription
InferTypesInfer numbers and booleans in CSV and untyped XML. Default true; JSON strings remain strings.
MaxCellsMaximum rectangular cell count including blanks; defaults to 1,000,000.
MaxColumnsMaximum columns; defaults to 16,384.
MaxFileBytesMaximum input bytes; defaults to 32 MiB.
MaxRowsMaximum rows, including generated headers; defaults to 1,048,576.
SheetNameImported worksheet name; defaults to Sheet1.

Examples

Import customer orders, configure bounded tabular exchange and export the processed values or a formatted workbook.

using TXTextControl.TXSheetControl.Server;

async Task<byte[]> ExchangeOrderDataAsync(ServerSheetControl control)
{
    await control.LoadTextAsync("<rows><row><Customer>Müller</Customer><Amount>125.5</Amount></row></rows>", StreamType.XML, new TabularLoadOptions { SheetName = "Orders", InferTypes = true, MaxFileBytes = 1048576, MaxRows = 1000, MaxColumns = 20, MaxCells = 20000 });

    var sheet=await control.Workbook.Sheets.AtAsync(0);
    await sheet.Range("A1:B1").FormatAsync(new { bold=true });
    return await control.SaveAsync(StreamType.SpreadsheetML);
}

See Also