This project has moved. For the latest updates, please go here.

Any easy way to format a particular column to be 'number' instead of 'text' when converting a dataset into xls ?

Jul 14, 2016 at 4:08 PM
 static void CreateExcelFromDataTable(DataTable dtExcel, string spName)
            XLWorkbook wb = new XLWorkbook();

            wb.Worksheets.Add(dtExcel, "dtExcel");
            string fileName = "ExcelFiles/" + spName + "_" + DateTime.Now.ToString("MM.dd.yyyy") + ".xlsx";
            wb.SaveAs(fileName.Replace("usp_", ""));
This works but for a particular column I need it to be formatted as 'number' when converted .. Any ideas ?