Esempio n. 1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            CrystalReportGeneral rpt = new CrystalReportGeneral();

            rpt.Site = this.Site;
            return(rpt);
        }
 private void FrmGeneralReport_Load(object sender, EventArgs e)
 {
     try
     {
         OleDbConnection cn = new OleDbConnection(@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + Application.StartupPath + "\\dbCitizen.accdb;Persist Security Info=True");
         //OleDbConnection cn = new OleDbConnection(@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Project 2016\SeniorCitizenICTDatabase\SeniorCitizenICTDatabase\dbCitizen.accdb;Persist Security Info=True");
         OleDbDataAdapter adapter = new OleDbDataAdapter("select UniqueCitizenId, CitizenFullname, Gender, DateOfBirth, PhoneNumber, StateOfOrigin, LGAOfOrigin from tblSeniorCitizen", cn);
         DataSet          ds      = new DataSet();
         adapter.Fill(ds, "GeneralReport");
         CrystalReportGeneral rpt = new CrystalReportGeneral();
         rpt.SetDataSource(ds);
         crystalReportViewer1.ReportSource = rpt;
     }
     catch (Exception er)
     {
         MessageBox.Show(er.Message);
     }
 }