目的: V80204A – [工作中心報工匯出]鈕 - 匯出Excle欄位值 - [數值]非[文字]
處理說明: 1> c#
sheet1.Range[myfunc.GetExcelPos(8, i + 1)].Text = dt.Rows[i]["SROTP"].ToString();
//設定[QTY] : 數值欄位
sheet1.Range[myfunc.GetExcelPos(9, i + 1)].Value = dt.Rows[i]["QTY"].ToString();
sheet1.Range[myfunc.GetExcelPos(9, i + 1)].NumberFormat = "#,##0.00";
sheet1.Range[myfunc.GetExcelPos(8, i + 1)].Text = dt.Rows[i]["SROTP"].ToString();
//設定[QTY] : 數值欄位
sheet1.Range[myfunc.GetExcelPos(9, i + 1)].Value = dt.Rows[i]["QTY"].ToString();
sheet1.Range[myfunc.GetExcelPos(9, i + 1)].NumberFormat = "#,##0.00";
[HttpPost]
public void WC_ALS_OutFile()
{
var c = HttpContext.Current;
NameValueCollection nvc = c.Request.Form;
sheet1.Range[myfunc.GetExcelPos(6, i + 1)].Text = dt.Rows[i]["MKDESCPT"].ToString();
sheet1.Range[myfunc.GetExcelPos(7, i + 1)].Text = dt.Rows[i]["WBS"].ToString();
sheet1.Range[myfunc.GetExcelPos(8, i + 1)].Text = dt.Rows[i]["SROTP"].ToString();
//設定[QTY] : 數值欄位
sheet1.Range[myfunc.GetExcelPos(9, i + 1)].Value = dt.Rows[i]["QTY"].ToString();
sheet1.Range[myfunc.GetExcelPos(9, i + 1)].NumberFormat = "#,##0.00";
//range.Value = "1175575.40";
//sheet1.Range[myfunc.GetExcelPos(16, i + 1)].Text = dt.Rows[i]["ALS_HR_"].ToString();
sheet1.Range[myfunc.GetExcelPos(16, i + 1)].Value = dt.Rows[i]["ALS_HR_"].ToString();
sheet1.Range[myfunc.GetExcelPos(16, i + 1)].NumberFormat = "#,##0.00";
沒有留言:
張貼留言