public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { rpt_PhanTichSL_CT rpt = new rpt_PhanTichSL_CT(); rpt.Site = this.Site; return(rpt); }
private void btnOk_Click(object sender, RoutedEventArgs e) { try { cls.ClsConnect(); int thamso = 6; string[] bien = new string[thamso]; object[] giatri = new object[thamso]; bien[0] = "@MaPos"; giatri[0] = bll.Left(CboPos.SelectedValue.ToString().Trim(), 6); bien[1] = "@Ngay"; giatri[1] = dtpNgay.SelectedDate.Value.ToString("dd/MM/yyyy"); if (giatri[1] == null) { MessageBox.Show("Chưa chọn ngày : ", "Mess"); return; } bien[2] = "@HTVAY"; if (Ration1.IsChecked == true) { giatri[2] = "1"; } else if (Ration2.IsChecked == true) { giatri[2] = "2"; } else { giatri[2] = "3"; } bien[3] = "@Nguon"; if (Ration4.IsChecked == true) { giatri[3] = "1"; } else if (Ration5.IsChecked == true) { giatri[3] = "2"; } else { giatri[3] = "3"; } bien[4] = "@Mau"; if (Ration7.IsChecked == true) { giatri[4] = "1"; } else if (Ration8.IsChecked == true) { giatri[4] = "2"; } bien[5] = "@MaXa"; giatri[5] = bll.Left(CboXa.SelectedValue.ToString().Trim(), 6); dt = cls.LoadDataProcPara("usp_PhanTichSL_CT", bien, giatri, thamso); if (dt.Rows.Count > 0) { rpt_PhanTichSL_CT rpt = new rpt_PhanTichSL_CT(); RPUtility.ShowRp(rpt, dt, this, srv.DbSourceSerVer(), srv.DbNameSerVer(), srv.DbUserSerVer(), srv.DbPassSerVer()); } else { MessageBox.Show("Không có dữ liệu ", "Mess"); } cls.DongKetNoi(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }