Ejemplo n.º 1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            CrystalReportBuilding rpt = new CrystalReportBuilding();

            rpt.Site = this.Site;
            return(rpt);
        }
Ejemplo n.º 2
0
 private void FrmBuildingAssetReport_Load(object sender, EventArgs e)
 {
     try
     {
         OleDbConnection cn = new OleDbConnection(@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + Application.StartupPath + "\\dbAsset.accdb;Persist Security Info=True");
         //OleDbConnection cn = new OleDbConnection(@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Project 2016\AutomatedAssetMIS\AutomatedAssetMIS\dbAsset.accdb;Persist Security Info=True");
         OleDbDataAdapter adapter = new OleDbDataAdapter("select Building_Name, Building_Type, Room_Number, Building_Owner_Name, Building_Agent_Name, Building_Agent_Phone, Building_Sale_Rentage from tblBuilding", cn);
         DataSet          ds      = new DataSet();
         adapter.Fill(ds, "Building");
         CrystalReportBuilding rpt = new CrystalReportBuilding();
         rpt.SetDataSource(ds);
         crystalReportViewer1.ReportSource = rpt;
     }
     catch (Exception er)
     {
         MessageBox.Show(er.Message);
     }
 }