예제 #1
0
        public String CascadaServicio(string idpais, string idnegocio)
        {
            string sError = "";

            JavaScriptSerializer varjon      = new JavaScriptSerializer();
            ReporteGenerico      ctrlReporte = new ReporteGenerico();

            ctrlReporte.cargaServiciosCascada(idpais, idnegocio, out sError);

            ViewBag.Error = sError;

            return(varjon.Serialize(ctrlReporte.dtServiciosJson));
        }
        // GET: Reportes

        /*******************************************************************
        * Métodos necesario para reporte genérico de cotizaciones
        * *****************************************************************/

        /*Método controlador de formulario de impresión de reporte genérico*/
        public ActionResult reporteGenerico()
        {
            String          errors;
            ReporteGenerico modelReporteGenerico = new ReporteGenerico();
            bool            res = modelReporteGenerico.cargaPaises(out errors);

            res = modelReporteGenerico.cargaNegocioPais(out errors);
            res = modelReporteGenerico.cargaServicioNegocio(out errors);
            res = modelReporteGenerico.cargaEstados(out errors);
            res = modelReporteGenerico.cargaElementos(out errors);
            res = modelReporteGenerico.cargaValores(out errors);
            return(View(modelReporteGenerico));
        }
        /// <summary>
        /// Convierte un objeto documentoInstanciaDto a la estructura que se requiere para crear el reporte
        /// y llama al metodo que genera el archivo xlsx
        /// </summary>
        /// <param name="rutaArchivoXBRL">Ruta del archivo XBRL a procesar</param>
        /// <param name="rutaDestino">Ruta destino donde se crear el archivo xlsx</param>
        /// <param name="idioma">Idioma en la que se va a generar el reporte</param>
        /// <param name="agruparPorunidad">Agrupacion de las columnas por unidad</param>
        public MemoryStream ExcelStream(string rutaArchivoXBRL, string idioma, bool agruparPorunidad)
        {
            if (!File.Exists(rutaArchivoXBRL))
            {
                throw new Exception(string.Format("El archivo {0} no existe", Path.GetFileName(rutaArchivoXBRL)));
            }

            var documentoInstancia = new DocumentoInstanciaXBRL();
            var xbrlViewerService  = new XbrlViewerService();

            documentoInstancia.Cargar(rutaArchivoXBRL);
            var             documentoInstanciaDto = xbrlViewerService.PreparaDocumentoParaVisor(documentoInstancia, null);
            ReporteGenerico reporteGenerico       = new ReporteGenerico();
            var             estruturaDeReporte    = reporteGenerico.GeneracionReporteGenerico(documentoInstanciaDto, idioma, agruparPorunidad);

            return(ReporteGenericoExcel(estruturaDeReporte, idioma, agruparPorunidad));
        }
        public String getReportGenerico(string id, string pais, string negocio, string servNegocio,
                                        string tieneComponentes, string tieneResumen, string tieneDetalle, string tieneCaracteristicas,
                                        string tieneHistoria, string elemento1, string elemento2, string elemento3, string codElemento1,
                                        string codElemento2, string codElemento3, string valElemento1, string valElemento2, string valElemento3,
                                        string fa_desde, string fa_hasta, string ff_desde, string ff_hasta, string estados, string flg_docto)
        {
            ReporteGenerico rpg = new ReporteGenerico();

            byte[] filestream = rpg.getReportGenerico(pais, negocio, servNegocio, tieneComponentes,
                                                      tieneResumen, tieneDetalle, tieneCaracteristicas, tieneHistoria, elemento1, elemento2, elemento3,
                                                      codElemento1, codElemento2, codElemento3, valElemento1, valElemento2, valElemento3, fa_desde,
                                                      fa_hasta, ff_desde, ff_hasta, estados, flg_docto);



            return(Convert.ToBase64String(filestream));
        }