private void cargar() { if (fechaDesdee.Value < fechaHastaa.Value) { DataTable tabla = new DataTable(); string fecha_desde = fechaDesdee.Value.Date.ToString("yyyy-MM-dd"); string fecha_hasta = fechaHastaa.Value.Date.ToString("yyyy-MM-dd"); int idProf = -1; if (cboProfesional.SelectedIndex != -1) { idProf = Convert.ToInt32(cboProfesional.SelectedValue); } tabla = oConsultaService.estadisticasConsulta(fecha_desde, fecha_hasta, idProf); if (tabla.Rows.Count == 0) { string msj = "No existen datos en el período elegido"; if (idProf != -1) { msj += " y/o del profesional seleccionado..."; } MessageBox.Show(msj, "Estadística no creada", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); fechaDesdee.Value = DateTime.Today; fechaHastaa.Value = DateTime.Today; } else { ReportDataSource ds = new ReportDataSource("DatosPractica", tabla); rpPracticasMes.LocalReport.DataSources.Clear(); rpPracticasMes.LocalReport.DataSources.Add(ds); this.rpPracticasMes.RefreshReport(); } } }