HasHeaders

CsvDataLoadOptions.HasHeaders property

Ottiene o imposta un valore che indica se il primo record di dati CSV contiene nomi di colonna.

public bool HasHeaders { get; set; }

Osservazioni

Il valore predefinito èfalso .

Esempi

Mostra come utilizzare CSV come origine dati (stringa).

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");

Guarda anche