hello,
I have a simmilar problem. I'm using a DataTable as source to export data to Excel File (xls)
When I opening this file all digits I have to convert from text to digit.
What Can I change in my code to solve problem "number stored as text" in my exported data in EXCEL file ??
When I exporting to XLSX I have the same problem and second problem - numeric digit has dot instead of comma. (XLS format has no problem with commas)
Br.
I have a simmilar problem. I'm using a DataTable as source to export data to Excel File (xls)
When I opening this file all digits I have to convert from text to digit.
What Can I change in my code to solve problem "number stored as text" in my exported data in EXCEL file ??
When I exporting to XLSX I have the same problem and second problem - numeric digit has dot instead of comma. (XLS format has no problem with commas)
using (XLWorkbook wb = new XLWorkbook())
{
wb.Worksheets.Add(dt);
Response.Clear();
Response.Buffer = true;
Response.Charset = "";
//Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
Response.ContentType = "application/vnd.ms-excel";
Response.AddHeader("content-disposition", "attachment;filename=File1.xls");
using (MemoryStream MyMemoryStream = new MemoryStream())
{
wb.SaveAs(MyMemoryStream);
MyMemoryStream.WriteTo(Response.OutputStream);
Response.Flush();
Response.End();
}
}
Thank you,Br.