2024年5月7日 星期二

V80204A – [工作中心報工匯出]鈕 - 匯出Excle欄位值-不套表 - [數值]非[文字] - NumberFormat -數值欄位 -不套表 - 直接匯出標題

 目的: 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";





1> c#
  [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";

沒有留言:

張貼留言