public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            CrystalReportPensionEnrolment rpt = new CrystalReportPensionEnrolment();

            rpt.Site = this.Site;
            return(rpt);
        }
示例#2
0
 private void FrmGeneralPensionEnrolReport_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 UniquePensionerId, PensionerFullName, DateOfBirth, PensionerGender, SalaryStructure, CurrentMonthlyPension, Ministry, NextOfKinName, NextOfKinPhoneNumber from tblPensionerEnrollment", cn);
         DataSet          ds      = new DataSet();
         adapter.Fill(ds, "tblPensionerEnrolment");
         CrystalReportPensionEnrolment rpt = new CrystalReportPensionEnrolment();
         rpt.SetDataSource(ds);
         crystalReportViewer1.ReportSource = rpt;
     }
     catch (Exception er)
     {
         MessageBox.Show(er.Message);
     }
 }