Example #1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            rp_TongHopNhapXuat rpt = new rp_TongHopNhapXuat();

            rpt.Site = this.Site;
            return(rpt);
        }
        private void btnBaoCao_Click(object sender, EventArgs e)
        {
            DataTable dt      = new DataTable();
            String    strLenh = "EXEC sp_RP_TongHop_NhapXuat '" + Program.mGroup + "','"
                                + convertStringToDateTime(dateNgayBatDau.Text.Trim()).ToString("yyyy-MM-dd") + "','"
                                + convertStringToDateTime(dateNgayKetThuc.Text.Trim()).ToString("yyyy-MM-dd") + "'";

            MessageBox.Show(strLenh);
            dt = Program.ExecSqlQuery(strLenh);
            rp_TongHopNhapXuat rp = new rp_TongHopNhapXuat();

            rp.SetDataSource(dt);
            rp.SetParameterValue("TUNGAY", convertStringToDateTime(dateNgayBatDau.Text.Trim()).ToString("yyyy-MM-dd"));
            rp.SetParameterValue("DENNGAY", convertStringToDateTime(dateNgayKetThuc.Text.Trim()).ToString("yyyy-MM-dd"));
            crystalReportViewer1.ReportSource = rp;
        }