Пример #1
0
        private void Frm_ThongKe_Load(object sender, EventArgs e)
        {
 
            //1 reset report
            this.rpv_BaoCao.Reset();
            //2 format report
            rpv_BaoCao.SetDisplayMode(Microsoft.Reporting.WinForms.DisplayMode.Normal);
            rpv_BaoCao.ZoomMode = Microsoft.Reporting.WinForms.ZoomMode.Percent;
            rpv_BaoCao.ZoomPercent = 100;

            //config

            DataSet1 dataset = new DataSet1();
            dataset.BeginInit();
            this.rpv_BaoCao.LocalReport.DataSources.Add(new Microsoft.Reporting.WinForms.ReportDataSource("DataSet1", dataset.Tables["DtHoaDon"]));
            this.rpv_BaoCao.LocalReport.ReportPath = "../../rptReportHoaDon.rdlc";
            this.rpv_BaoCao.Location = new System.Drawing.Point(0, 0);
            dataset.EndInit();

            DataSet1TableAdapters.DtHoaDonTableAdapter DTHoaDon = new DataSet1TableAdapters.DtHoaDonTableAdapter();
            DTHoaDon.Connection.ConnectionString = HDon_PTA.sChuoiKetNoi();
            DTHoaDon.ClearBeforeFill = true;

            if (sDk != "")
                DTHoaDon.FillBy(dataset.DtHoaDon, sDk);
            else
                DTHoaDon.Fill(dataset.DtHoaDon);


                     

            this.rpv_BaoCao.RefreshReport();
        }
Пример #2
0
        private void Frm_ThongKe_Load(object sender, EventArgs e)
        {
            //1 reset report
            this.rpv_BaoCao.Reset();
            //2 format report
            rpv_BaoCao.SetDisplayMode(Microsoft.Reporting.WinForms.DisplayMode.Normal);
            rpv_BaoCao.ZoomMode    = Microsoft.Reporting.WinForms.ZoomMode.Percent;
            rpv_BaoCao.ZoomPercent = 100;

            //config

            DataSet1 dataset = new DataSet1();

            dataset.BeginInit();
            this.rpv_BaoCao.LocalReport.DataSources.Add(new Microsoft.Reporting.WinForms.ReportDataSource("DataSet1", dataset.Tables["DtHoaDon"]));
            this.rpv_BaoCao.LocalReport.ReportPath = "../../rptReportHoaDon.rdlc";
            this.rpv_BaoCao.Location = new System.Drawing.Point(0, 0);
            dataset.EndInit();

            DataSet1TableAdapters.DtHoaDonTableAdapter DTHoaDon = new DataSet1TableAdapters.DtHoaDonTableAdapter();
            DTHoaDon.Connection.ConnectionString = HDon_PTA.sChuoiKetNoi();
            DTHoaDon.ClearBeforeFill             = true;

            if (sDk != "")
            {
                DTHoaDon.FillBy(dataset.DtHoaDon, sDk);
            }
            else
            {
                DTHoaDon.Fill(dataset.DtHoaDon);
            }



            this.rpv_BaoCao.RefreshReport();
        }