private void btnCTTDP_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e) { //ReportDocument cryRpt = new ReportDocument(); //string[] _str = Application.StartupPath.Split('\\'); //string path = String.Join("\\", _str.Take(_str.Count() - 2).ToArray()); //cryRpt.Load(path + @"\Report\rpChiTietThueDatPhong.rpt"); //frmNgay _frm = new frmNgay(); //_frm.txtMa.Enabled = false; //_frm.StartPosition = FormStartPosition.CenterScreen; //_frm.ShowDialog(); //cryRpt.SetParameterValue("NgayBatDau", _frm.NgayBatDau); //cryRpt.SetParameterValue("NgayKetThuc", _frm.NgayKetThuc); //crv.ReportSource = cryRpt; //crv.Refresh(); var rp = new Report.rpChiTietThueDatPhong(); frmNgay _frm = new frmNgay(); _frm.txtMa.Enabled = false; _frm.StartPosition = FormStartPosition.CenterScreen; _frm.ShowDialog(); CrystalDecisions.Shared.TableLogOnInfo info; info = rp.Database.Tables[0].LogOnInfo; info.ConnectionInfo.ServerName = "192.168.1.39"; info.ConnectionInfo.DatabaseName = "QLKS"; rp.Database.Tables[0].ApplyLogOnInfo(info); rp.SetParameterValue("NgayBatDau", _frm.NgayBatDau); rp.SetParameterValue("NgayKetThuc", _frm.NgayKetThuc); rp.ReportOptions.EnableSaveDataWithReport = false; crv.ReportSource = rp; }
public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { rpChiTietThueDatPhong rpt = new rpChiTietThueDatPhong(); rpt.Site = this.Site; return rpt; }