Exemple #1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            CrystalReportMonthlyVerification rpt = new CrystalReportMonthlyVerification();

            rpt.Site = this.Site;
            return(rpt);
        }
 private void FrmMonthlyVerificationReport_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, CurrentMonthlyPension, VerificationMonth, VerificationYear, BankName, AccountNumber, VerificationStatus from tblMonthlyVerification where (VerificationMonth = '" + verificationMonth + "') and (VerificationYear = '" + verificationYear + "')", cn);
         DataSet          ds      = new DataSet();
         adapter.Fill(ds, "tblMonthlyVerification");
         CrystalReportMonthlyVerification rpt = new CrystalReportMonthlyVerification();
         rpt.SetDataSource(ds);
         crystalReportViewer1.ReportSource = rpt;
     }
     catch (Exception er)
     {
         MessageBox.Show(er.Message);
     }
 }