Пример #1
0
        private void button3_Click(object sender, EventArgs e)
        {
            LogicaGo  logica = new LogicaGo();
            DataTable datos  = logica.obtenerIngresosGastos(txtDpFechaIni.Text, txtDpFechaFin.Text);

            ReportParameter[] parameters = new ReportParameter[2];
            parameters[0] = new ReportParameter("FechaIni", txtDpFechaIni.Text);
            parameters[1] = new ReportParameter("FechaFin", txtDpFechaFin.Text);
            reportViewer1.LocalReport.SetParameters(parameters);
            ReportDataSource rds = new ReportDataSource("dsIngresosGastos", datos);

            this.reportViewer1.LocalReport.DataSources.Clear();
            this.reportViewer1.LocalReport.DataSources.Add(rds);
            this.reportViewer1.LocalReport.Refresh();
            this.reportViewer1.RefreshReport();
        }