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

Commented Unassigned: Cannot change the category from "General" to "Numbers" in format cells while exporting from datatable to Excel [9338]

$
0
0
While exporting from Datatble to excel ..even though the generated spreadsheet contains numbers as right -aligned the category in Format cells is set to "General" and not "Numbers".
I have checked the datatable columns datatype and changed the datatype of cells accordingly.
e.g
if (col.Value == "Int32")
{
cell.DataType = CellValues.Number;
cell.CellValue = new CellValue(rowtext);
}

I formatted the Date cells using custom format by adding stylesheet and setting NumberFromatId and FormatCode. Now in the generated sheet category in Format cells is set to "Custom" and not "General".

Then why doesnt it change for numbers??
Comments: How can I reproduce it?

Viewing all articles
Browse latest Browse all 1877

Trending Articles



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