Пример #1
0
        private void RefreshDataGrid(DateTime?tglawal, DateTime?tglakhir)
        {
            ReportDataSource reportDataSource1 = new ReportDataSource();

            DSKenko dataSet1 = new DSKenko();

            dataSet1.BeginInit();
            dataSet1.EnforceConstraints = false;

            reportDataSource1.Name = "DSKenko";
            //Name of the report dataset in our .RDLC file

            reportDataSource1.Value = dataSet1.sp_LaporanReservasi;

            _reportViewer.Reset();

            ReportParameter[] param = new ReportParameter[3];
            param[0] = new ReportParameter("tglAwal", tglawal.HasValue ? tglawal.Value.ToString("dd/MM/yyyy") : "");
            param[1] = new ReportParameter("tglAkhir", tglakhir.HasValue ? tglakhir.Value.ToString("dd/MM/yyyy") : "");
            param[2] = new ReportParameter("namaManager", Application.Current.Properties["nama"].ToString());


            _reportViewer.LocalReport.DataSources.Add(reportDataSource1);
            _reportViewer.ZoomMode = ZoomMode.PageWidth;
            _reportViewer.LocalReport.ReportPath = "../../rdlc/LaporanReservasiDesigner.rdlc";
            _reportViewer.LocalReport.SetParameters(param);
            dataSet1.EndInit();


            DSKenkoTableAdapters.sp_LaporanReservasiTableAdapter t = new DSKenkoTableAdapters.sp_LaporanReservasiTableAdapter();
            t.ClearBeforeFill = true;
            t.Fill(dataSet1.sp_LaporanReservasi, tglawal, tglakhir);
            _reportViewer.RefreshReport();
        }
Пример #2
0
        private void RefreshDataGrid(string statusObat)
        {
            ReportDataSource reportDataSource1 = new ReportDataSource();

            DSKenko dataSet1 = new DSKenko();

            dataSet1.BeginInit();

            reportDataSource1.Name = "DSKenko";
            //Name of the report dataset in our .RDLC file

            reportDataSource1.Value = dataSet1.sp_LaporanObat;

            _reportViewer.Reset();

            ReportParameter[] param = new ReportParameter[2];
            param[0] = new ReportParameter("statusObat", statusObat == "Semua" ? "" : statusObat);
            param[1] = new ReportParameter("namaManager", Application.Current.Properties["nama"].ToString());


            _reportViewer.LocalReport.DataSources.Add(reportDataSource1);
            _reportViewer.ZoomMode = ZoomMode.PageWidth;
            _reportViewer.LocalReport.ReportPath = "../../rdlc/LaporanObatDesigner.rdlc";
            _reportViewer.LocalReport.SetParameters(param);
            dataSet1.EndInit();

            //fill data into WpfApplication4DataSet
            DSKenkoTableAdapters.sp_LaporanObatTableAdapter t = new DSKenkoTableAdapters.sp_LaporanObatTableAdapter();
            t.ClearBeforeFill = true;
            t.Fill(dataSet1.sp_LaporanObat, statusObat);
            _reportViewer.RefreshReport();
        }