private void cargar() { if (dtpDesde.Value < dtpHasta.Value) { DataTable tabla = new DataTable(); string fecha_desde = dtpDesde.Value.Date.ToString("yyyy-MM-dd"); string fecha_hasta = dtpHasta.Value.Date.ToString("yyyy-MM-dd"); int idProf = -1; if (cboOdontologos.SelectedIndex != -1) { idProf = Convert.ToInt32(cboOdontologos.SelectedValue); } tabla = oTServ.estadisticaConcretados(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); dtpDesde.Value = DateTime.Today; dtpHasta.Value = DateTime.Today; } else { ReportDataSource ds = new ReportDataSource("DataSet1", tabla); rpvTurnosConcretados.LocalReport.DataSources.Clear(); rpvTurnosConcretados.LocalReport.DataSources.Add(ds); this.rpvTurnosConcretados.RefreshReport(); } } }