CsvDataLoadOptions.CommentChar

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

CsvDataLoadOptions.CommentChar property

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

public char CommentChar { get; set; }

Examples

Shows how to fill template with data from CSV data source loaded from file using LINQ Reporting engine.

CsvDataLoadOptions csvLoadOptions = new CsvDataLoadOptions();
csvLoadOptions.QuoteChar = '\'';
csvLoadOptions.CommentChar = '|';
csvLoadOptions.Delimiter = ',';
csvLoadOptions.HasHeaders = true;
CsvDataSource ds = new CsvDataSource(MyDir + "ReportingData.csv", csvLoadOptions);

ReportBuilderOptions reportBuilderOptions = new ReportBuilderOptions();
reportBuilderOptions.AllowMissingMembers = true;

using (Stream input = File.OpenRead(MyDir + "ReportingTemplateForeach.docx"))
using (Stream output = File.Create(ArtifactsDir + "ReportingForeachCsvDataSource.pdf"))
{
    ReportBuilder.BuildReport(input, output, SaveFormat.Pdf, ds, "data", reportBuilderOptions);
}

See Also