//Boton para generar todos los reportes
        private void btnreporte_Click(object sender, RoutedEventArgs e)
        {
            if (txtreporte.Text == string.Empty)
            {
                viewerInstance.LocalReport.DataSources.Clear();
                viewerInstance.LocalReport.DataSources.Add(new ReportDataSource("DSReportePromotor", _rep.ObtenerPromotoresPorNombres()));
                viewerInstance.LocalReport.ReportPath = "..\\..\\ReportePromotor.rdlc";
                viewerInstance.RefreshReport();

            }

            else
            {
                //Filtrado por fecha de actividaddes
                ReportePromotor _reppro = new ReportePromotor();
                _reppro.Fecha_Actividad = txtreporte.Text;
                viewerInstance.LocalReport.DataSources.Clear();
                viewerInstance.LocalReport.DataSources.Add(new ReportDataSource("DSReportePromotor", _rep.ObtenerPromotoresPorFechasDeActividades(_reppro)));
                viewerInstance.LocalReport.ReportPath = "..\\..\\ReportePromotor.rdlc";
                viewerInstance.RefreshReport();

            }
        }
Ejemplo n.º 2
0
 public List<ReportePromotor> ObtenerPromotoresPorNombres(ReportePromotor pPromotore)
 {
     return BDComun.Contexto.ReportePromotors.ToList();
 }
Ejemplo n.º 3
0
 public List<ReportePromotor> ObtenerPromotoresPorFechasDeActividades(ReportePromotor pPromotore)
 {
     return BDComun.Contexto.ReportePromotors.Where(c => c.Fecha_Actividad == pPromotore.Fecha_Actividad).ToList();
 }