Quantcast
Channel: ClosedXML - The easy way to OpenXML
Viewing all articles
Browse latest Browse all 1877

Edited Unassigned: Export empty DataTable ignores DataColumn Caption [9423]

$
0
0
In the current implementation, when exporting a DataTable to excel via InsertTable method, if a DataColumn.Caption is not null or whitespace then the DataColumn.Caption string is taken into account for Excel's column names instead of DataColumn.ColumnName.

However, if the exported DataTable has no rows, the DataColumnCaption field is not taken into account and DataColumn.ColumnName is used.

I believe it would be nice to have the same behaviour for column names for both cases.

Steps to reproduce:

1. Create a DataTable with no rows but with some DataColumns.
2. Fill the DataColumn.Caption field with some non-whitespace string
3. Export the DataTable with worksheet.Cell("A1").InsertTable(dataTable);


Viewing all articles
Browse latest Browse all 1877

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>