ClosedXMLSQL データ テーブルから Excel にデータをエクスポートするために使用しています。
これはエクスポートの一部です: (dt は SQL Server からのデータを含むデータテーブルです)
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=Report.xlsx");
using (MemoryStream MyMemoryStream = new MemoryStream())
{
wb.SaveAs(MyMemoryStream);
MyMemoryStream.WriteTo(Response.OutputStream);
Response.Flush();
Response.End();
}
}
問題は次のとおりです。
すべての数字をエクスポートした後、テキストとして
10 進数にはドットがありますが、カンマが必要です
Excel へのエクスポートを正しくフォーマットする方法を教えてください。