Delimiter

CsvDataLoadOptions.Delimiter property

Obtient ou définit le caractère à utiliser comme délimiteur de colonne.

public char Delimiter { get; set; }

Remarques

La valeur par défaut est ‘,’ (virgule).

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