public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { rpt_khb1 rpt = new rpt_khb1(); rpt.Site = this.Site; return(rpt); }
private void bntOk_Click(object sender, RoutedEventArgs e) { try { bll.TaoThuMuc(Thumuc); cls.ClsConnect(); int thamso = 2; string[] bien = new string[thamso]; object[] giatri = new object[thamso]; bien[0] = "@Ngay"; if (dtpNgay.SelectedDate != null) { giatri[0] = dtpNgay.SelectedDate.Value.ToString("yyyy-MM-dd"); bien[1] = "@MaPos"; giatri[1] = bll.Left(cboPos.SelectedValue.ToString().Trim(), 6); //MessageBox.Show(giatri[0] + " " + giatri[1]); //dt = cls.LoadDataProcPara("usp_KHB", bien, giatri, thamso); dt1 = cls.LoadDataProcPara("usp_khb1", bien, giatri, thamso); //dt2 = cls.LoadDataProcPara("usp_khb2", bien, giatri, thamso); rpt_khb1 rpt1 = new rpt_khb1(); RPUtility.ShowRp(rpt1, dt1, this, srv.DbSourceSerVer(), srv.DbNameSerVer(), srv.DbUserSerVer(), srv.DbPassSerVer()); //rpt_khb2 rpt2 = new rpt_khb2(); //RPUtility.ShowRp(rpt2, dt2, this, srv.DbSourceSerVer(), srv.DbNameSerVer(), srv.DbUserSerVer(), srv.DbPassSerVer()); dt3 = cls.LoadDataProcPara("usp_khb3", bien, giatri, thamso); rpt_khb3 rpt3 = new rpt_khb3(); RPUtility.ShowRp(rpt3, dt3, this, srv.DbSourceSerVer(), srv.DbNameSerVer(), srv.DbUserSerVer(), srv.DbPassSerVer()); dt4 = cls.LoadDataProcPara("usp_KHB4", bien, giatri, thamso); rpt_khb4 rpt4 = new rpt_khb4(); RPUtility.ShowRp(rpt4, dt4, this, srv.DbSourceSerVer(), srv.DbNameSerVer(), srv.DbUserSerVer(), srv.DbPassSerVer()); // FileName = Thumuc + "\\KHB03_" + dtpNgay.SelectedDate.Value.ToString("ddMMyyyy") + ".xlsx"; } // bll.WriteDataTableToExcel(dt2, "Person Details", FileName, "Details"); // MessageBox.Show("Copy Excel to : " + FileName); } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error); } finally { cls.DongKetNoi(); } }