/// <summary> /// CAA20報表 /// </summary> /// <param name="ParameterList">變數清單</param> /// <returns>回傳查詢結果</returns> public DataTable CAA04_1(ArrayList ParameterList) { CAAModel.RecordingInvoiceDetail bco = new CAAModel.RecordingInvoiceDetail(ConntionDB); DataTable Dt = bco.GetInvoiceBatch(ParameterList); if (Dt.Rows.Count == 0) { throw new Exception("查無資料"); } else { return Dt; } }
private void RunReport(ReportType RType) { #region 檢查條件 CAAModel.CAACommon CAAComm = new CAAModel.CAACommon(); ArrayList arl_Check_Condition = Check_Condition(); #region 如果檢查有誤,則Return if (arl_Check_Condition[1].ToString() != string.Empty) { #region 錯誤訊息 this.ErrorMsgLabel.Text = arl_Check_Condition[1].ToString(); #endregion #region Focus欄位 if (arl_Check_Condition[0].ToString() != string.Empty) { string s_ScriptManager_Script = CAAComm.ToMakeUp_SetFocus_Script(arl_Check_Condition[0].ToString(), true); ScriptManager.RegisterStartupScript(this.up_ErrorMsg, typeof(UpdatePanel), "CAA041", s_ScriptManager_Script, true); } #endregion return; } #endregion #endregion DataTable dt; string strSourceS = ddlSource_Type_S.SelectedValue; string strSourceE = ddlSource_Type_E.SelectedValue; if (int.Parse(strSourceS) > int.Parse(strSourceE)) { strSourceS = ddlSource_Type_E.SelectedValue; strSourceE = ddlSource_Type_S.SelectedValue; } ParameterList.Clear(); ParameterList.Add(SLP_InvoDateRange.StartDate); ParameterList.Add(SLP_InvoDateRange.EndDate); ParameterList.Add(strSourceS); ParameterList.Add(strSourceE); ParameterList.Add(rblTaxType.Text); CAAModel.RecordingInvoiceDetail BCO = new CAAModel.RecordingInvoiceDetail(ConntionDB); dt = BCO.GetInvoiceBatch(ParameterList); if (dt.Rows.Count == 0) { ErrorMsgLabel.Text = "查無資料"; } else { string s_FileName = HttpUtility.UrlEncode("批次電子發票開立明細表." + ((RType == ReportType.PDF) ? "pdf" : "xls"), System.Text.Encoding.UTF8); string s_rptFilePath = Server.MapPath("./REPORT/CAA041/CAA04R01.rpt"); LoadCrystalReport(s_FileName, s_rptFilePath, dt, ((RType == ReportType.PDF) ? ExportFormatType.PortableDocFormat : ExportFormatType.Excel)); } }