public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { rpt_khtc07 rpt = new rpt_khtc07(); rpt.Site = this.Site; return(rpt); }
private void btnOk_Click(object sender, RoutedEventArgs e) { try { 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_Khtc07", bien, giatri, thamso); if (dt.Rows.Count > 0) { rpt_khtc07 rpt = new rpt_khtc07(); 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(); } catch (Exception ex) { MessageBox.Show("Lổi " + ex.Message, "Mess"); } }