public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { crptPersonalInfo rpt = new crptPersonalInfo(); rpt.Site = this.Site; return(rpt); }
private void btnPrintReport_Click(object sender, EventArgs e) { if (dataGridView.Rows.Count > 0) { DataRow dr = DBConn.getCompanyNameAndAddress(); if (dr == null) { return; } crptPersonalInfo rptObj = new crptPersonalInfo(); rptObj.SetDataSource(DS.Tables[0]); rptObj.SetParameterValue(0, dr["VCOMPANY_NAME"]); rptObj.SetParameterValue(1, dr["VCOMPANY_ADDRESS"]); frmCrystalReportViewer crpt = new frmCrystalReportViewer(); crpt.crptViewer.ReportSource = null; crpt.crptViewer.ReportSource = rptObj; crpt.Show(); } else { MessageBox.Show("", "Data Not Found !", MessageBoxButtons.OK, MessageBoxIcon.Error); } }