public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { OutstandingRecoveriesRPT rpt = new OutstandingRecoveriesRPT(); rpt.Site = this.Site; return(rpt); }
private void cmdDisplay1_Click_1(object sender, EventArgs e) { try { DataSet dataSetReport = new DataSet(); dataSetReport = myReports.getOutstandingRecoveries(); dataSetReport.WriteXml("OutstandingRecoveries.xml"); if (dataSetReport.Tables[0].Rows.Count > 0) { OutstandingRecoveriesRPT myaclist = new OutstandingRecoveriesRPT(); myaclist.SetDataSource(dataSetReport); ReportViewer myReportViewer = new ReportViewer(); myaclist.SetParameterValue("CompanyName", FTSPayRollBL.Company.getCompanyName()); myaclist.SetParameterValue("Estate", mydiv.ListEstates().Rows[0][0].ToString()); myReportViewer.crystalReportViewer1.ReportSource = myaclist; myReportViewer.Show(); } else { MessageBox.Show("No data to preview..!"); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }