StreamType Enumeration
- Namespace
TXTextControl.TXSheetControl. Server
- Package
TXTextControl.from the private NuGet feed or the supplied NuGet folderTXSheetControl. Server
- Assembly
TXTextControl.TXSheetControl. Api. dll
- Install
dotnet add package TXTextControl..NET 10 and later.TXSheetControl. Server
- Also in
TXTextControl.asTXSheetControl. Blazor 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
| Member | Value | Description |
|---|---|---|
CSV | 3 | |
InternalWorkbookFormat | 1 | |
JSON | 5 | |
PDF | 2 | |
SpreadsheetML | 0 | |
XML | 4 | |
OpenDocumentSpreadsheet | 6 | OpenDocument 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?[][]
{
[],
[],
[]
});
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);