CommentChar

CsvDataLoadOptions.CommentChar property

Gets or sets the character that is used to comment lines of CSV data.

public char CommentChar { get; set; }

Remarks

The default value is ‘#’ (number sign).

Examples

Shows how to use CSV as a data source (string).

Document doc = new Document(MyDir + "Reporting engine template - CSV data destination.docx");

CsvDataLoadOptions loadOptions = new CsvDataLoadOptions(true);
loadOptions.Delimiter = ';';
loadOptions.CommentChar = '$';
loadOptions.HasHeaders = true;
loadOptions.QuoteChar = '"';

CsvDataSource dataSource = new CsvDataSource(MyDir + "List of people.csv", loadOptions);
BuildReport(doc, dataSource, "persons");

doc.Save(ArtifactsDir + "ReportingEngine.CsvDataString.docx");

See Also