public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { rpt_XLN_M4 rpt = new rpt_XLN_M4(); rpt.Site = this.Site; return(rpt); }
private void OK_OnClick(object sender, RoutedEventArgs e) { try { cls.ClsConnect(); int thamso = 4; string[] bien = new string[thamso]; object[] giatri = new object[thamso]; bien[0] = "@MaPos"; giatri[0] = str.Left(CboPos.SelectedValue.ToString().Trim(), 6); bien[1] = "@MaXa"; giatri[1] = str.Left(CboXa.SelectedValue.ToString().Trim(), 6); bien[2] = "@Ngay"; if (dtpNgay.SelectedDate != null) { giatri[2] = dtpNgay.SelectedDate.Value.ToString("yyyy-MM-dd"); } bien[3] = "@Mau"; if (Ration1.IsChecked == true) { giatri[3] = "1"; } else if (Ration2.IsChecked == true) { giatri[3] = "2"; } else { giatri[3] = "3"; } dt = cls.LoadLdbf("usp_XLN_M4", bien, giatri, thamso); if (dt.Rows.Count > 0) { rpt_XLN_M4 rpt = new rpt_XLN_M4(); RPUtility.ShowRp(rpt, dt, this, srv.DbSourceSerVer(), srv.DbNameSerVer(), srv.DbUserSerVer(), srv.DbPassSerVer()); } else { MessageBox.Show("Không có khế ước nào đến hạn !", "Thông báo", MessageBoxButton.OK, MessageBoxImage.Warning); } } catch (Exception ex) { MessageBox.Show("Error \n" + ex.Message, "Mess", MessageBoxButton.OK, MessageBoxImage.Error); } finally { cls.DongKetNoi(); } }