public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { rpt_QT_KHTC_NEW rpt = new rpt_QT_KHTC_NEW(); rpt.Site = this.Site; return(rpt); }
private void btnOk_Click(object sender, RoutedEventArgs e) { // MessageBox.Show(BienBll.Ndma); ServerInfor srv = new ServerInfor(); _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] = _str.Left(cboPos.SelectedValue.ToString().Trim(), 6); _dt = _cls.LoadDataProcPara("usp_KHTC", bien, giatri, thamso); if (_dt.Rows.Count > 0) { if (BienBll.NdMadv.Trim() == BienBll.MainPos.Trim()) { rpt_QT_KHTC_NEW rpt = new rpt_QT_KHTC_NEW(); RPUtility.ShowRp(rpt, _dt, this, srv.DbSourceSerVer(), srv.DbNameSerVer(), srv.DbUserSerVer(), srv.DbPassSerVer()); //FileName = Thumuc + "\\" + giatri[1] + "_KHTC_" + dtpNgay.SelectedDate.Value.ToString("ddMMyyyy") + ".csv"; //_str.ExportToExcel(_dt, FileName); //MessageBox.Show("Copy Excel to : " + FileName, "Thông báo", MessageBoxButton.OK, MessageBoxImage.Information); //_str.OpenExcel(FileName); } else { rpt_QT_KHTCHuyen_NEW rpt = new rpt_QT_KHTCHuyen_NEW(); RPUtility.ShowRp(rpt, _dt, this, srv.DbSourceSerVer(), srv.DbNameSerVer(), srv.DbUserSerVer(), srv.DbPassSerVer()); } } else { MessageBox.Show("Chưa có số liệu", "Thông báo"); } _cls.DongKetNoi(); }