CommentChar

CsvDataLoadOptions.CommentChar property

Obtient ou définit le caractère utilisé pour commenter les lignes de données CSV.

public char CommentChar { get; set; }

Remarques

La valeur par défaut est ‘#’ (signe dièse).

Exemples

Montre comment utiliser CSV comme source de données (chaîne).

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

Voir également