/// <summary> /// COM05報表 /// </summary> /// <param name="ParameterList">變數清單</param> /// <returns>回傳查詢結果</returns> public string COM05_1(ArrayList ParameterList, string ReportOutputFormat, ref ReportList.ExcelOtherType EOT ) { COMModel.QueryNonQtyByStore bco = new COMModel.QueryNonQtyByStore(ConntionDB); DataTable Dt = bco.QueryByStore(ParameterList); if (Dt.Rows.Count == 0) { throw new Exception("查無資料"); } else { return ExportCSV(Dt); } }
protected void Btn_Export_Click(object sender, EventArgs e) { try { ErrorMsgLabel.Text = ""; BCO.QueryNonQtyByStore BCO = new BCO.QueryNonQtyByStore(ConntionDB); DataTable Dt; ParameterList.Clear(); ParameterList.Add(this.SLP_STAcceptDate.StartDate.ToString().Trim()); ParameterList.Add(this.SLP_STAcceptDate.EndDate.ToString().Trim()); Dt = BCO.QueryByStore(ParameterList); if (Dt == null || (Dt != null && Dt.Rows.Count <= 0)) { ErrorMsgLabel.Text = "查無差異資料"; } else { #region 設定頁面狀態 this.hid_PageStatus.Value = "PRINT"; this.txt_PageStatus.Text = "PRINT"; #endregion #region 顯示報表 string s_FileName = ""; //設定輸出檔名 string s_rptFilePath = ""; //設定報表路徑 ExportCSV(Dt, "單店取消進貨報表.csv"); #endregion } } catch (Exception ex) { this.ErrorMsgLabel.Text = ex.ToString(); } finally { } }