Table of Contents

Interface ICsvExporter

Namespace
NuvTools.Report.Sheet.Csv
Assembly
NuvTools.Report.dll

Exports documents to CSV format encoded as base64 strings.

public interface ICsvExporter

Methods

ExportFirstSheetToCsv(Document, CsvDelimiter, string?, bool, bool)

Exports the first table in a document to a CSV file encoded as a base64 string.

string ExportFirstSheetToCsv(Document document, CsvDelimiter delimiter = CsvDelimiter.Comma, string? customDelimiter = null, bool includeHeader = true, bool sanitizeDelimiter = true)

Parameters

document Document

The document containing the table to export.

delimiter CsvDelimiter

The delimiter to use. Defaults to Comma.

customDelimiter string

A custom delimiter string, required when delimiter is Custom.

includeHeader bool

Whether to include the header row with column labels. Defaults to true.

sanitizeDelimiter bool

Whether to remove occurrences of the delimiter from header labels and cell values to prevent CSV corruption. Defaults to true.

Returns

string

A base64-encoded CSV string of the first table.

ExportToCsv(Document, CsvDelimiter, string?, bool, bool)

Exports all tables in a document to separate CSV files encoded as base64 strings.

List<string> ExportToCsv(Document document, CsvDelimiter delimiter = CsvDelimiter.Comma, string? customDelimiter = null, bool includeHeader = true, bool sanitizeDelimiter = true)

Parameters

document Document

The document containing tables to export.

delimiter CsvDelimiter

The delimiter to use. Defaults to Comma.

customDelimiter string

A custom delimiter string, required when delimiter is Custom.

includeHeader bool

Whether to include the header row with column labels. Defaults to true.

sanitizeDelimiter bool

Whether to remove occurrences of the delimiter from header labels and cell values to prevent CSV corruption. Defaults to true.

Returns

List<string>

A list of base64-encoded CSV strings, one for each table in the document.