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

            rpt.Site = this.Site;
            return(rpt);
        }
示例#2
0
        private void InHoaDon_Load(object sender, EventArgs e)
        {
            ReportDocument objrep = new rpHoaDon();
            SqlConnection  mycon  = new SqlConnection(@"Data Source=LAPTOP-DSA2JMNK\SQLEXPRESS;Initial Catalog=test;Integrated Security=True");

            mycon.Open();
            SqlDataAdapter data = new SqlDataAdapter(Program.sql,
                                                     mycon);
            DataSet ds = new DataSet();

            data.Fill(ds, Program.sql);
            objrep.SetDataSource(ds.Tables[0]);
            crystalReportViewer1.ReportSource = objrep;
            crystalReportViewer1.Refresh();
        }