CsvSaveOptions Class
- 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
- Inherits
- Save
Options - Tabular
Save Options - Csv
Save Options
- Save
UTF-8 CSV output contains every selected row and uses double-quote escaping.
Syntax
public class CsvSaveOptions
Members
Constructors
| Constructor | Description |
|---|---|
| Constructor |
Properties
| Property | Description |
|---|---|
| Bom | Include a UTF-8 byte-order mark; defaults to false. |
| DecimalSeparator | Decimal separator for numbers: period (default) or comma. |
| Delimiter | One non-quote, non-newline delimiter; defaults to comma. |
| EscapeFormulas | Prefix formula-like text with an apostrophe for spreadsheet consumers. Default true; false preserves exact text. |
| LineEnding | CRLF (default) or LF record ending. Embedded line breaks stay in quoted fields. |
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("Customer;Amount;Total\nMüller;125,5;0", StreamType.CSV, new CsvLoadOptions {Delimiter=";",DecimalSeparator=",",SheetName="Orders"});
var sheet=await control.Workbook.Sheets.AtAsync(0);
await sheet.Cell("C2").SetFormulaAsync("=B2*1.19");
return await control.SaveAsync(StreamType.CSV, new CsvSaveOptions { SheetName = "Orders", Range = "A1:C2", HasHeaderRow = true, MaxCells = 10000, MaxFileBytes = 1048576, Delimiter = ";", DecimalSeparator = ",", Bom = true, LineEnding = "\r\n", EscapeFormulas = true });
}