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
sheetNamestringThe sheet's name, compared without regard to case.
writerTextWriterWhere the text goes. It is not closed.
optionsXlsxCsvOptionsHow 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
sheetNameorwriteris 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.