TX Sheet Control

StreamType Enumeration

Enumeration
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

Document file formats shared with JavaScript. SpreadsheetML is .xlsx; native files use .txwb.

Syntax

public enum StreamType

Interfaces: IComparable, ISpanFormattable, IFormattable, IConvertible.

Members

MemberValueDescription
CSV3
InternalWorkbookFormat1
JSON5
PDF2
SpreadsheetML0
XML4
OpenDocumentSpreadsheet6OpenDocument Spreadsheet (.ods), read and write.

Examples

Create one invoice and export both its editable XLSX workbook and its PDF rendition.

using TXTextControl.TXSheetControl.Server;

async Task<(byte[] Xlsx, byte[] Pdf)> ExportInvoiceFormatsAsync(ServerSheetControl control)
{
    var book = control.Workbook;
    var sheet = await book.Sheets.AtAsync(0);
    await sheet.Range("A7:D9").SetValuesAsync(new object?[][]
    {
        ["Description", "Quantity", "UnitPrice", "Amount"],
        ["Consulting", 3, 120, 360],
        ["Training", 2, 90, 180]
    });

    var table = await sheet.Tables.AddAsync("InvoiceLines", "A7:D9", new TableOptions { Style = "TableStyleMedium2", ShowRowStripes = true });
    await sheet.Cell("A1").SetTextAsync("October invoice");
    await sheet.Cell("A1").FormatAsync(new { fontFamily = "Liberation Sans", fontSize = 16, bold = true, textColor = "#ffffff", fillColor = "#163b63" });
    await sheet.Range("C8:D9").FormatAsync(new { numberFormatCode = "#,##0.00", fontFamily = "Liberation Sans", fontSize = 11 });

    var xlsx = await control.SaveAsync(StreamType.SpreadsheetML);
    var pdf = await control.SaveAsync(StreamType.PDF);
    return (xlsx, pdf);
}

See Also

OpenDocument Spreadsheet

Select this value for binary .ods input and output.

var ods = await control.SaveAsync(StreamType.OpenDocumentSpreadsheet);