Table of Contents

Method ToCsv

Namespace
DocWright.Spreadsheet
Assembly
DocWright.Spreadsheet.dll

ToCsv(string, TextWriter, XlsxCsvOptions?)

Writes one sheet as delimited text (CSV). See ToCsv(TextWriter, XlsxCsvOptions?).

public void ToCsv(string sheetName, TextWriter writer, XlsxCsvOptions? options = null)

Parameters

sheetName string

The sheet's name, compared without regard to case.

writer TextWriter

Where the text goes. It is not closed.

options XlsxCsvOptions

How to write, or null for the defaults.

Remarks

Excel's own CSV save writes the sheet that is showing; here the sheet is named.

Exceptions

ArgumentNullException

sheetName or writer is null.

ArgumentException

The workbook has no sheet of that name, or an option is not valid.

InvalidOperationException

The sheet is not a worksheet.

ResourceLimitExceededException

The range covers more cells than MaxCells.

InvalidDocumentException

The sheet's part is malformed.