HasHeaders

CsvDataLoadOptions.HasHeaders property

Gets or sets a value indicating whether the first record of CSV data contains column names.

public bool HasHeaders { get; set; }

Remarks

The default value is false.

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