i am trying to export a datatable to excel ..for columns with int datatype changing cell.DataType= cellvalues.Numbers works . but cell.DataType= cellvalues.Date does not work.
Plus using custom formatting and setting NumberFormatId=15 (built in format) displays only the date part of entire date i.e 14-Mar-2014 is displayed as 14.
Comments: I have no clue what you mean on the first so post a piece of code to reproduce it. The second one works fine: ws.FirstCell().SetValue(DateTime.Now) .Style.NumberFormat.NumberFormatId = 15; The cell contains "2-Jul-14"
Plus using custom formatting and setting NumberFormatId=15 (built in format) displays only the date part of entire date i.e 14-Mar-2014 is displayed as 14.
Comments: I have no clue what you mean on the first so post a piece of code to reproduce it. The second one works fine: ws.FirstCell().SetValue(DateTime.Now) .Style.NumberFormat.NumberFormatId = 15; The cell contains "2-Jul-14"