예제 #1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            rpbaocaohangbanchay rpt = new rpbaocaohangbanchay();

            rpt.Site = this.Site;
            return(rpt);
        }
        private void reporthangbanchay_Load(object sender, EventArgs e)
        {
            var query = "SELECT TBL_HOADONCT.MASAPHAM, TBL_HOADONCT.TENSANPHAM, TBL_HOADONCT.SOLUONG, TBL_HOADONCT.GIA, TBL_HOADON.NGAYBAN " +
                        "FROM TBL_HOADON CROSS JOIN TBL_HOADONCT";

            try
            {
                SqlDataAdapter    da  = new SqlDataAdapter(query, ModuleDB.cnn);
                SqlCommandBuilder cmm = new SqlCommandBuilder(da);
                DataTable         a   = new DataTable();
                da.Fill(a);
                rpbaocaohangbanchay rphbc = new rpbaocaohangbanchay();
                rphbc.SetDataSource(a);
                crystalReportViewer1.ReportSource = rphbc;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }