MiniExcel
MiniExcel copied to clipboard
DynamicColumns Name not working as expected
Description
I've tried this code to format my columns with custom name but it is not working as expected. Here is a minimal reproducible example:
dynamic results = new List<dynamic>();
var resultRow = new ExpandoObject() as IDictionary<string, Object>;
resultRow.Add("Code", 12345);
results.Add(resultRow);
var resultsExcelConfig = new OpenXmlConfiguration
{
DynamicColumns = new DynamicExcelColumn[] {
new DynamicExcelColumn("Code"){Name="Code Custom Name"},
}
};
MiniExcel.SaveAs(myPath, results, configuration: resultsExcelConfig);
The resulting file has an empty column header with no data. If I omit the configuration, the code works but the column name is the default one...