public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { crRegistration_Confirmation_Report_DSE_21_4 rpt = new crRegistration_Confirmation_Report_DSE_21_4(); rpt.Site = this.Site; return(rpt); }
private void btnViewReport_Click(object sender, EventArgs e) { Registration_Confirmation_Reports_DSE_21_4BAL objBAL = new Registration_Confirmation_Reports_DSE_21_4BAL(); DataTable data = new DataTable(); frmReportViewer rptviewer = new frmReportViewer(); crRegistration_Confirmation_Report_DSE_21_4 objrpt = new crRegistration_Confirmation_Report_DSE_21_4(); _boid = txtByBOID.Text; _custCode = txtByCustCode.Text; _custName = txtByName.Text; try { CheckValidation(); //SetCustInfo(); if (txtByBOID.Text == "" && txtByName.Text == "") { _boid = objBAL.GetBoid(_custCode, _custName); _custName = objBAL.GetCustName(_custCode, _boid); //_custCode = objBAL.GetCustCode(_custName, _boid); } else if (txtByName.Text == string.Empty && txtByCustCode.Text == string.Empty) { _custName = objBAL.GetCustName(_custCode, _boid); //_boid = objBAL.GetBoid(_custCode, _custName); _custCode = objBAL.GetCustCode(_custName, _boid); } else if (txtByCustCode.Text == string.Empty || txtByBOID.Text == string.Empty) { _custCode = objBAL.GetCustCode(_custName, _boid); _boid = objBAL.GetBoid(_custCode, _custName); //_custName = objBAL.GetCustName(_custCode, _boid); } data = objBAL.GetRegistrationConfirmationReportData(_custCode, _boid, _custName); objrpt.SetDataSource(data); rptviewer.crvReportViewer.ReportSource = objrpt; rptviewer.Show(); ResetCustInfo(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }