public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { CrystalReportPensionPayment rpt = new CrystalReportPensionPayment(); rpt.Site = this.Site; return(rpt); }
private void FrmPensionPaymentReport_Load(object sender, EventArgs e) { try { OleDbConnection cn = new OleDbConnection(@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + Application.StartupPath + "\\dbPension.accdb;Persist Security Info=True"); //OleDbConnection cn = new OleDbConnection(@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Project 2016\PensionVerificationSystem\PensionVerificationSystem\dbPension.accdb;Persist Security Info=True"); OleDbDataAdapter adapter = new OleDbDataAdapter("select PensionerId, PensionerFullname, MonthlyPensionPayment, PensionArears, GrativityInArears, BankName, AccountNumber, InitialMonth, InitialYear from tblPensionPayment", cn); DataSet ds = new DataSet(); adapter.Fill(ds, "tblPensionPayment"); CrystalReportPensionPayment rpt = new CrystalReportPensionPayment(); rpt.SetDataSource(ds); crystalReportViewer1.ReportSource = rpt; } catch (Exception er) { MessageBox.Show(er.Message); } }