You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to write a report list of objects to csv without header so set the HasHeaderRecord to false.
but it's still adding columns' name as a header row.
`using (var writer = new StringWriter())
using (var csv = GetCsvWriter(writer, false))
{
csv.Context.RegisterClassMap();
var data = mapper.Map<List<ExportContactTracingReportModel>>(report) :
csv.WriteRecords(data);
}
public static CsvWriter GetCsvWriter(StringWriter writer, bool hasHeaderRecord = true)
=> new CsvWriter(writer,
new CsvConfiguration(CultureInfo.InvariantCulture)
{
InjectionOptions = InjectionOptions.Strip,
HasHeaderRecord = hasHeaderRecord,
});`
The text was updated successfully, but these errors were encountered:
I want to write a report list of objects to csv without header so set the HasHeaderRecord to false.
but it's still adding columns' name as a header row.
`using (var writer = new StringWriter())
using (var csv = GetCsvWriter(writer, false))
{
csv.Context.RegisterClassMap();
The text was updated successfully, but these errors were encountered: