Exemplo n.º 1
0
        private void Form1_Load(object sender, EventArgs e)
        {
            OleDbConnection con = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=De1.mdb");
            try
            {
                con.Open();
                da = new OleDbDataAdapter("select * from BanSach", con);
                da.Fill(ds,"BanSach");
                DataTable dt = new DataTable();
                dt = ds.Tables["BanSach"];
                CrystalReport1 rpt = new CrystalReport1();
                rpt.SetDataSource(dt);
                crystalReportViewer1.ReportSource = rpt;

            }
            catch (Exception)
            {

                throw;
            }
        }
Exemplo n.º 2
0
 public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
 {
     CrystalReport1 rpt = new CrystalReport1();
     rpt.Site = this.Site;
     return rpt;
 }