private void ReportViewer_Requisicion() { try { var _reporte = new ReportesView(); PopUpsViewModels.ShowPopUp(this, PopUpsViewModels.TipoPopUp.OSCURECER_FONDO); _reporte.Closed += (s, e) => { PopUpsViewModels.ClosePopUp(PopUpsViewModels.TipoPopUp.OSCURECER_FONDO); }; _reporte.Owner = PopUpsViewModels.MainWindow; _reporte.Show(); _reporte.Report.LocalReport.ReportPath = "Reportes/rTraslados_Egresos.rdlc"; _reporte.Report.LocalReport.DataSources.Clear(); Microsoft.Reporting.WinForms.ReportDataSource rsd1 = new Microsoft.Reporting.WinForms.ReportDataSource(); rsd1.Name = "DS_DETALLE"; rsd1.Value = ds_detalle; Microsoft.Reporting.WinForms.ReportDataSource rsd2 = new Microsoft.Reporting.WinForms.ReportDataSource(); rsd2.Name = "DS_ENCABEZADO"; rsd2.Value = ds_encabezado; _reporte.Report.LocalReport.DataSources.Add(rsd1); _reporte.Report.LocalReport.DataSources.Add(rsd2); _reporte.Report.RefreshReport(); } catch (Exception ex) { StaticSourcesViewModel.ShowMessageError("Algo pasó...", "Ocurrió un error al salvar el traslado.", ex); } }
//PLANIMETRIA REPORTES private void ImprimirReporte() { try { if (SelectedSector != null) { var centro = new cCentro().Obtener(GlobalVar.gCentro).FirstOrDefault(); var reporteDatos = new List <cReporteDatos>(); reporteDatos.Add(new cReporteDatos() { Encabezado1 = Parametro.ENCABEZADO1, Encabezado2 = Parametro.ENCABEZADO2, Titulo = "PLANIMETRIA", Logo1 = Parametro.REPORTE_LOGO1, Logo2 = Parametro.REPORTE_LOGO2, Centro = centro.DESCR.Trim() }); var reporte = new List <cImputadoPlanimetria>(); var internos = new cIngreso().ObtenerIngresosPorSector(SelectedSector.ID_CENTRO, SelectedSector.ID_EDIFICIO, SelectedSector.ID_SECTOR); if (internos != null) { foreach (var i in internos) { string paterno = i.IMPUTADO.PATERNO; if (!string.IsNullOrEmpty(paterno)) { paterno = paterno.Trim(); } string materno = i.IMPUTADO.MATERNO; if (!string.IsNullOrEmpty(materno)) { materno = materno.Trim(); } string nombre = i.IMPUTADO.NOMBRE; if (!string.IsNullOrEmpty(nombre)) { nombre = nombre.Trim(); } var clasificacion = string.Empty; if (i.CAMA != null) { if (i.CAMA.SECTOR_OBSERVACION_CELDA != null) { if (i.CAMA.SECTOR_OBSERVACION_CELDA.SECTOR_OBSERVACION != null) { if (i.CAMA.SECTOR_OBSERVACION_CELDA.SECTOR_OBSERVACION.SECTOR_CLASIFICACION != null) { clasificacion = i.CAMA.SECTOR_OBSERVACION_CELDA.SECTOR_OBSERVACION.SECTOR_CLASIFICACION.POBLACION; } } } } reporte.Add(new cImputadoPlanimetria() { ///TODO: cambios en el modelo //Clasificacion = i.CAMA.CELDA.SECTOR_OBSERVACION_CELDA.FirstOrDefault().SECTOR_OBSERVACION.SECTOR_CLASIFICACION.POBLACION, Clasificacion = clasificacion, Centro = i.CENTRO.DESCR, Anio = i.ID_ANIO.ToString(), Imputado = i.ID_IMPUTADO.ToString(), APaterno = string.Empty, AMaterno = string.Empty, Nombre = string.Format("{0} {1} {2}", paterno, materno, nombre), Estancia = i.CAMA.CELDA.ID_CELDA, Cama = i.CAMA.ID_CAMA.ToString() }); } var view = new ReportesView(); PopUpsViewModels.ShowPopUp(this, PopUpsViewModels.TipoPopUp.OSCURECER_FONDO); view.Closed += (s, e) => { PopUpsViewModels.ClosePopUp(PopUpsViewModels.TipoPopUp.OSCURECER_FONDO); }; view.Owner = PopUpsViewModels.MainWindow; view.Show(); //ARMAMOS EL REPORTE view.Report.LocalReport.ReportPath = "Reportes/rPlanimetria.rdlc"; view.Report.LocalReport.DataSources.Clear(); var generales = new List <cGeneralesPlanimetria>(); generales.Add(new cGeneralesPlanimetria() { Centro = "CERESO DE MEXICALI", Ubicacion = SelectedSector.DESCR }); Microsoft.Reporting.WinForms.ReportDataSource rds1 = new Microsoft.Reporting.WinForms.ReportDataSource(); rds1.Name = "DataSet1"; rds1.Value = generales; view.Report.LocalReport.DataSources.Add(rds1); Microsoft.Reporting.WinForms.ReportDataSource rds2 = new Microsoft.Reporting.WinForms.ReportDataSource(); rds2.Name = "DataSet2"; rds2.Value = reporte; view.Report.LocalReport.DataSources.Add(rds2); Microsoft.Reporting.WinForms.ReportDataSource rds3 = new Microsoft.Reporting.WinForms.ReportDataSource(); rds3.Name = "DataSet3"; rds3.Value = reporteDatos; view.Report.LocalReport.DataSources.Add(rds3); view.Report.RefreshReport(); } } else { new Dialogos().ConfirmacionDialogo("Notificacion", "Favor de seleccionar un sector"); } } catch (Exception ex) { StaticSourcesViewModel.ShowMessageError("Algo pasó...", "Ocurrió un error al generar reporte", ex); } }
private void ImprimirRecetaMedica() { try { if (SelectedNotaMedica == null) { return; } ReportesView View = new ReportesView(); PopUpsViewModels.ShowPopUp(this, PopUpsViewModels.TipoPopUp.OSCURECER_FONDO); View.Owner = PopUpsViewModels.MainWindow; View.Closed += (s, e) => { PopUpsViewModels.ClosePopUp(PopUpsViewModels.TipoPopUp.OSCURECER_FONDO); }; View.Show(); var _UsuarioActual = new SSP.Controlador.Catalogo.Justicia.cUsuario().GetData(x => x.ID_USUARIO.Trim() == GlobalVar.gUsr).FirstOrDefault(); cRecetaMedicaReporte DatosReporte = new cRecetaMedicaReporte() { Edad = SelectedNotaMedica.ATENCION_MEDICA != null ? SelectedNotaMedica.ATENCION_MEDICA.INGRESO != null ? SelectedNotaMedica.ATENCION_MEDICA.INGRESO.IMPUTADO != null ? new Fechas().CalculaEdad(SelectedNotaMedica.ATENCION_MEDICA.INGRESO.IMPUTADO.NACIMIENTO_FECHA).ToString() : string.Empty : string.Empty : string.Empty, Fecha = Fechas.GetFechaDateServer.ToString("dd/MM/yyyy"), NoExpediente = string.Format("{0} / {1}", SelectedNotaMedica.ATENCION_MEDICA != null ? SelectedNotaMedica.ATENCION_MEDICA.ID_ANIO.HasValue ? SelectedNotaMedica.ATENCION_MEDICA.ID_ANIO.Value.ToString() : string.Empty : string.Empty, SelectedNotaMedica.ATENCION_MEDICA != null ? SelectedNotaMedica.ATENCION_MEDICA.ID_IMPUTADO.HasValue ? SelectedNotaMedica.ATENCION_MEDICA.ID_IMPUTADO.Value.ToString() : string.Empty : string.Empty), NombrePaciente = string.Format("{0} {1} {2}", SelectedNotaMedica.ATENCION_MEDICA != null ? SelectedNotaMedica.ATENCION_MEDICA.INGRESO != null ? SelectedNotaMedica.ATENCION_MEDICA.INGRESO.IMPUTADO != null ? !string.IsNullOrEmpty(SelectedNotaMedica.ATENCION_MEDICA.INGRESO.IMPUTADO.NOMBRE) ? SelectedNotaMedica.ATENCION_MEDICA.INGRESO.IMPUTADO.NOMBRE.Trim() : string.Empty : string.Empty : string.Empty : string.Empty, SelectedNotaMedica.ATENCION_MEDICA != null ? SelectedNotaMedica.ATENCION_MEDICA.INGRESO != null ? SelectedNotaMedica.ATENCION_MEDICA.INGRESO.IMPUTADO != null ? !string.IsNullOrEmpty(SelectedNotaMedica.ATENCION_MEDICA.INGRESO.IMPUTADO.PATERNO) ? SelectedNotaMedica.ATENCION_MEDICA.INGRESO.IMPUTADO.PATERNO.Trim() : string.Empty : string.Empty : string.Empty : string.Empty, SelectedNotaMedica.ATENCION_MEDICA != null ? SelectedNotaMedica.ATENCION_MEDICA.INGRESO != null ? SelectedNotaMedica.ATENCION_MEDICA.INGRESO.IMPUTADO != null ? !string.IsNullOrEmpty(SelectedNotaMedica.ATENCION_MEDICA.INGRESO.IMPUTADO.MATERNO) ? SelectedNotaMedica.ATENCION_MEDICA.INGRESO.IMPUTADO.MATERNO.Trim() : string.Empty : string.Empty : string.Empty : string.Empty), Estancia = string.Format("{0}-{1}{2}-{3}", SelectedNotaMedica.ATENCION_MEDICA != null ? SelectedNotaMedica.ATENCION_MEDICA.INGRESO != null ? SelectedNotaMedica.ATENCION_MEDICA.INGRESO.CAMA.CELDA != null ? SelectedNotaMedica.ATENCION_MEDICA.INGRESO.CAMA.CELDA.SECTOR != null ? SelectedNotaMedica.ATENCION_MEDICA.INGRESO.CAMA.CELDA.SECTOR.EDIFICIO != null ? !string.IsNullOrEmpty(SelectedNotaMedica.ATENCION_MEDICA.INGRESO.CAMA.CELDA.SECTOR.EDIFICIO.DESCR) ? SelectedNotaMedica.ATENCION_MEDICA.INGRESO.CAMA.CELDA.SECTOR.EDIFICIO.DESCR.Trim() : string.Empty : string.Empty : string.Empty : string.Empty : string.Empty : string.Empty, SelectedNotaMedica.ATENCION_MEDICA != null ? SelectedNotaMedica.ATENCION_MEDICA.INGRESO != null ? SelectedNotaMedica.ATENCION_MEDICA.INGRESO.CAMA.CELDA != null ? SelectedNotaMedica.ATENCION_MEDICA.INGRESO.CAMA.CELDA.SECTOR != null ? !string.IsNullOrEmpty(SelectedNotaMedica.ATENCION_MEDICA.INGRESO.CAMA.CELDA.SECTOR.DESCR) ? SelectedNotaMedica.ATENCION_MEDICA.INGRESO.CAMA.CELDA.SECTOR.DESCR.Trim() : string.Empty : string.Empty : string.Empty : string.Empty : string.Empty, SelectedNotaMedica.ATENCION_MEDICA != null ? SelectedNotaMedica.ATENCION_MEDICA.INGRESO != null ? SelectedNotaMedica.ATENCION_MEDICA.INGRESO.CAMA.CELDA != null ? !string.IsNullOrEmpty(SelectedNotaMedica.ATENCION_MEDICA.INGRESO.CAMA.CELDA.ID_CELDA) ? SelectedNotaMedica.ATENCION_MEDICA.INGRESO.CAMA.CELDA.ID_CELDA.Trim() : string.Empty : string.Empty : string.Empty : string.Empty, SelectedNotaMedica.ATENCION_MEDICA != null ? SelectedNotaMedica.ATENCION_MEDICA.INGRESO != null ? SelectedNotaMedica.ATENCION_MEDICA.INGRESO.ID_UB_CAMA.HasValue ? SelectedNotaMedica.ATENCION_MEDICA.INGRESO.ID_UB_CAMA.Value.ToString() : string.Empty : string.Empty : string.Empty), FC = SelectedNotaMedica.ATENCION_MEDICA != null ? SelectedNotaMedica.ATENCION_MEDICA.NOTA_SIGNOS_VITALES != null ? !string.IsNullOrEmpty(SelectedNotaMedica.ATENCION_MEDICA.NOTA_SIGNOS_VITALES.FRECUENCIA_CARDIAC) ? SelectedNotaMedica.ATENCION_MEDICA.NOTA_SIGNOS_VITALES.FRECUENCIA_CARDIAC.Trim() : string.Empty : string.Empty : string.Empty, FR = SelectedNotaMedica.ATENCION_MEDICA != null ? SelectedNotaMedica.ATENCION_MEDICA.NOTA_SIGNOS_VITALES != null ? !string.IsNullOrEmpty(SelectedNotaMedica.ATENCION_MEDICA.NOTA_SIGNOS_VITALES.FRECUENCIA_RESPIRA) ? SelectedNotaMedica.ATENCION_MEDICA.NOTA_SIGNOS_VITALES.FRECUENCIA_RESPIRA.Trim() : string.Empty : string.Empty : string.Empty, TA = SelectedNotaMedica.ATENCION_MEDICA != null ? SelectedNotaMedica.ATENCION_MEDICA.NOTA_SIGNOS_VITALES != null ? !string.IsNullOrEmpty(SelectedNotaMedica.ATENCION_MEDICA.NOTA_SIGNOS_VITALES.TENSION_ARTERIAL) ? SelectedNotaMedica.ATENCION_MEDICA.NOTA_SIGNOS_VITALES.TENSION_ARTERIAL.Trim() : string.Empty : string.Empty : string.Empty, T = SelectedNotaMedica.ATENCION_MEDICA != null ? SelectedNotaMedica.ATENCION_MEDICA.NOTA_SIGNOS_VITALES != null ? !string.IsNullOrEmpty(SelectedNotaMedica.ATENCION_MEDICA.NOTA_SIGNOS_VITALES.TEMPERATURA) ? SelectedNotaMedica.ATENCION_MEDICA.NOTA_SIGNOS_VITALES.TEMPERATURA.Trim() : string.Empty : string.Empty : string.Empty, Servicio = SelectedNotaMedica.ATENCION_MEDICA != null ? SelectedNotaMedica.ATENCION_MEDICA.ATENCION_SERVICIO != null ? !string.IsNullOrEmpty(SelectedNotaMedica.ATENCION_MEDICA.ATENCION_SERVICIO.DESCR) ? SelectedNotaMedica.ATENCION_MEDICA.ATENCION_SERVICIO.DESCR.Trim() : string.Empty : string.Empty : string.Empty, Generico = _UsuarioActual != null?string.Format("{0} {1} {2}", _UsuarioActual.EMPLEADO != null?_UsuarioActual.EMPLEADO.PERSONA != null? !string.IsNullOrEmpty(_UsuarioActual.EMPLEADO.PERSONA.NOMBRE)?_UsuarioActual.EMPLEADO.PERSONA.NOMBRE.Trim() : string.Empty : string.Empty : string.Empty, _UsuarioActual.EMPLEADO != null?_UsuarioActual.EMPLEADO.PERSONA != null? !string.IsNullOrEmpty(_UsuarioActual.EMPLEADO.PERSONA.PATERNO)?_UsuarioActual.EMPLEADO.PERSONA.PATERNO.Trim() : string.Empty : string.Empty : string.Empty, _UsuarioActual.EMPLEADO != null?_UsuarioActual.EMPLEADO.PERSONA != null? !string.IsNullOrEmpty(_UsuarioActual.EMPLEADO.PERSONA.MATERNO)?_UsuarioActual.EMPLEADO.PERSONA.MATERNO.Trim() : string.Empty : string.Empty : string.Empty) : string.Empty, Generico2 = _UsuarioActual != null ? _UsuarioActual.EMPLEADO != null ? !string.IsNullOrEmpty(_UsuarioActual.EMPLEADO.CEDULA) ? _UsuarioActual.EMPLEADO.CEDULA.Trim() : string.Empty : string.Empty : string.Empty }; System.Collections.Generic.List <cMedicamentosRecetaMedica> ListaMedicamentos = new System.Collections.Generic.List <cMedicamentosRecetaMedica>(); if (LstMedicamentosConAnotaciones != null && LstMedicamentosConAnotaciones.Any()) { foreach (var item in LstMedicamentosConAnotaciones) { ListaMedicamentos.Add(new cMedicamentosRecetaMedica { Cantidad = item.Cantidad, Duracion = item.Duracion, Noche = item.Noche, Maniana = item.Maniana, Observaciones = item.Anotaciones, Presentacion = string.Format("{0} {1}", item.NombreMedicamento, !string.IsNullOrEmpty(item.OBSERVACIONES) ? string.Format("({0})", item.OBSERVACIONES.Trim()) : string.Empty), UnidadMedida = item.UnidadMedida, Tarde = item.Tarde, }); } } ; var _CeresoActual = new SSP.Controlador.Catalogo.Justicia.cCentro().GetData(x => x.ID_CENTRO == GlobalVar.gCentro).FirstOrDefault(); var Encabezado = new cEncabezado() { TituloUno = _CeresoActual != null ? !string.IsNullOrEmpty(_CeresoActual.DESCR) ? _CeresoActual.DESCR.Trim() : string.Empty : string.Empty, TituloDos = Parametro.ENCABEZADO2, ImagenIzquierda = Parametro.REPORTE_LOGO2, ImagenFondo = Parametro.REPORTE_LOGO_MEDICINA }; View.Report.LocalReport.ReportPath = "Reportes/rRecetaMedica.rdlc"; View.Report.LocalReport.DataSources.Clear(); var ds1 = new System.Collections.Generic.List <cEncabezado>(); ds1.Add(Encabezado); Microsoft.Reporting.WinForms.ReportDataSource rds1 = new Microsoft.Reporting.WinForms.ReportDataSource(); rds1.Name = "DataSet1"; rds1.Value = ds1; View.Report.LocalReport.DataSources.Add(rds1); var ds2 = new System.Collections.Generic.List <cRecetaMedicaReporte>(); ds2.Add(DatosReporte); Microsoft.Reporting.WinForms.ReportDataSource rds2 = new Microsoft.Reporting.WinForms.ReportDataSource(); rds2.Name = "DataSet2"; rds2.Value = ds2; View.Report.LocalReport.DataSources.Add(rds2); Microsoft.Reporting.WinForms.ReportDataSource rds3 = new Microsoft.Reporting.WinForms.ReportDataSource(); rds3.Name = "DataSet3"; rds3.Value = ListaMedicamentos; View.Report.LocalReport.DataSources.Add(rds3); View.Report.RefreshReport(); } catch (System.Exception exc) { throw exc; } }
private async Task Reporte() { try { var reporte = new List <cReporte>(); var totales = new List <cEMIPendienteTotal>(); var ingresos = new List <cEMIPendienteListado>(); var centro = new cCentro().Obtener(GlobalVar.gCentro).SingleOrDefault(); //DATOS DEL REPORTE reporte.Add(new cReporte() { Logo1 = Parametro.LOGO_ESTADO, Encabezado1 = Parametro.ENCABEZADO1, Encabezado2 = Parametro.ENCABEZADO2, Encabezado3 = centro.DESCR.Trim().ToUpper(), Encabezado4 = filtro == (short)enumEMIPendiente.EMI_INCOMPLETO ? "INTERNOS CON ENTREVISTAS MULTIDICIPLINARIAS INCOMPLETAS" : "INTERNOS SIN ENTREVISTAS MULTIDICIPLINARIAS" }); totales.Add(new cEMIPendienteTotal() { Total = Total }); if (filtro == (short)enumEMIPendiente.SIN_EMI) { ingresos = new List <cEMIPendienteListado>(new cIngreso().ObtenerSinEMI(GlobalVar.gCentro).Select(w => new cEMIPendienteListado { Anio = w.ID_ANIO, Folio = w.ID_IMPUTADO, Paterno = w.IMPUTADO.PATERNO, Materno = w.IMPUTADO.MATERNO, Nombre = w.IMPUTADO.NOMBRE, Cama = w.CAMA, Celda = w.CAMA.CELDA, Sector = w.CAMA.CELDA.SECTOR, Edificio = w.CAMA.CELDA.SECTOR.EDIFICIO, Pendiente = string.Empty, EsPendiente = 0 })); } else { ingresos = new List <cEMIPendienteListado>(); var emi_incompleto = new cIngreso().ObtenerEMIIncompleto(GlobalVar.gCentro, "P"); foreach (var obj in emi_incompleto) { var emi = obj.EMI_INGRESO.FirstOrDefault().EMI; ingresos.Add(new cEMIPendienteListado { Anio = obj.ID_ANIO, Folio = obj.ID_IMPUTADO, Paterno = obj.IMPUTADO.PATERNO, Materno = obj.IMPUTADO.MATERNO, Nombre = obj.IMPUTADO.NOMBRE, Cama = obj.CAMA, Celda = obj.CAMA.CELDA, Sector = obj.CAMA.CELDA.SECTOR, Edificio = obj.CAMA.CELDA.SECTOR.EDIFICIO, EsPendiente = 1, PSituacionJuridica = emi.EMI_SITUACION_JURIDICA, PFactoresGrupoFamiliar = emi.EMI_FACTORES_SOCIO_FAMILIARES, PDrogas = emi.EMI_USO_DROGA.Count, PHPS = emi.EMI_HPS, PClasificacionCriminologica = emi.EMI_CLAS_CRIMINOLOGICA }); } //ingresos = new List<cEMIPendienteListado>(new cIngreso().ObtenerEMIIncompleto(GlobalVar.gCentro, "P").Select(w => new cEMIPendienteListado { Anio = w.ID_ANIO, Folio = w.ID_IMPUTADO, Paterno = w.IMPUTADO.PATERNO, Materno = w.IMPUTADO.MATERNO, Nombre = w.IMPUTADO.NOMBRE,Cama = w.CAMA,Celda = w.CAMA.CELDA,Sector = w.CAMA.CELDA.SECTOR, Edificio = w.CAMA.CELDA.SECTOR.EDIFICIO, // EsPendiente = 1, // PSituacionJuridica = w.EMI_INGRESO.FirstOrDefault().EMI.EMI_SITUACION_JURIDICA, // //PFactoresGrupoFamiliar = w.EMI_INGRESO.FirstOrDefault().EMI.EMI_FACTORES_SOCIO_FAMILIARES, // //PDrogas = w.EMI_INGRESO.FirstOrDefault().EMI.EMI_USO_DROGA.Count, // //PHPS = w.EMI_INGRESO.FirstOrDefault().EMI.EMI_HPS, // //PClasificacionCriminologica = w.EMI_INGRESO.FirstOrDefault().EMI.EMI_CLAS_CRIMINOLOGICA //})); } var view = new ReportesView(); PopUpsViewModels.ShowPopUp(this, PopUpsViewModels.TipoPopUp.OSCURECER_FONDO); view.Owner = PopUpsViewModels.MainWindow; view.Closed += (s, e) => { PopUpsViewModels.ClosePopUp(PopUpsViewModels.TipoPopUp.OSCURECER_FONDO); }; view.Show(); #region Genera Reporte view.Report.LocalReport.ReportPath = "Reportes/rEMIPendiente.rdlc"; view.Report.LocalReport.DataSources.Clear(); Microsoft.Reporting.WinForms.ReportDataSource rds1 = new Microsoft.Reporting.WinForms.ReportDataSource(); rds1.Name = "DataSet1"; rds1.Value = reporte; view.Report.LocalReport.DataSources.Add(rds1); Microsoft.Reporting.WinForms.ReportDataSource rds2 = new Microsoft.Reporting.WinForms.ReportDataSource(); rds2.Name = "DataSet2"; rds2.Value = totales; view.Report.LocalReport.DataSources.Add(rds2); Microsoft.Reporting.WinForms.ReportDataSource rds3 = new Microsoft.Reporting.WinForms.ReportDataSource(); rds3.Name = "DataSet3"; rds3.Value = ingresos; view.Report.LocalReport.DataSources.Add(rds3); #endregion view.Report.RefreshReport(); } catch (Exception ex) { StaticSourcesViewModel.ShowMessageError("Algo pasó...", "Ocurrió un error al imprimir reporte.", ex); } }