コード例 #1
0
        /// <summary>
        /// Atiende los requerimientos entrantes, correspondientes a la Capa de Reportes
        /// </summary>
        /// <param name="poReporte">Especificaciones del reporte a construir</param>
        /// <param name="poFuenteDatos">Fuente de datos del reporte</param>
        /// <returns>Regresa un objeto, basándose en el tipo de salida especificado en el reporte</returns>
        public object Presentar(Entidades.Informe poReporte, DataSet poFuenteDatos)
        {
            try
            {
                switch (poReporte.Tipo)
                {
                case Definiciones.TipoInforme.Web:
                    InformeWeb loReporteWeb = new InformeWeb(poReporte, poFuenteDatos);

                    return(loReporteWeb.Procesar());

                case Definiciones.TipoInforme.WindowsForm:
                    InformeWinForms loReporteWindowsForm = new InformeWinForms(poReporte, poFuenteDatos);

                    return(loReporteWindowsForm.Procesar());

                default:
                    break;
                }
            }
            catch (Exception ex)
            {
                throw new Excepcion(ex.Message, ex);
            }

            return(null);
        }
コード例 #2
0
ファイル: Informe.cs プロジェクト: MH3Dapesa/Dapesa
        protected Informe(Entidades.Informe poReporte)
        {
            string lsUnidadMedida = poReporte.UnidadMedida.Descripcion();

            this._nAlto            = poReporte.Alto;
            this._nAncho           = poReporte.Ancho;
            this._nCopias          = poReporte.Copias;
            this._nMargenDerecho   = poReporte.MargenDerecho;
            this._nMargenInferior  = poReporte.MargenInferior;
            this._nMargenIzquierdo = poReporte.MargenIzquierdo;
            this._nMargenSuperior  = poReporte.MargenSuperior;
            this._oFormato         = poReporte.Formato;
            this._oSalida          = poReporte.Salida;
            this._sConfiguracion   =
                "<DeviceInfo>" +
                "  <OutputFormat>" + poReporte.Formato.ToString() + "</OutputFormat>" +
                "  <PageHeight>" + poReporte.Alto + lsUnidadMedida + "</PageHeight>" +
                "  <PageWidth>" + poReporte.Ancho + lsUnidadMedida + "</PageWidth>" +
                "  <MarginBottom>" + poReporte.MargenInferior + lsUnidadMedida + "</MarginBottom>" +
                "  <MarginLeft>" + poReporte.MargenIzquierdo + lsUnidadMedida + "</MarginLeft>" +
                "  <MarginRight>" + poReporte.MargenDerecho + lsUnidadMedida + "</MarginRight>" +
                " <MarginTop>" + poReporte.MargenSuperior + lsUnidadMedida + "</MarginTop>" +
                "</DeviceInfo>";
            this._sExtension = poReporte.Extension;
            this._sImpresora = poReporte.Impresora;
            this._sNombre    = poReporte.Nombre;
            this._sUbicacion = poReporte.Ubicacion;
        }
コード例 #3
0
        internal InformeWinForms(Entidades.Informe poInforme, DataSet poFuenteDatos)
            : base(poInforme)
        {
            this._oInforme            = new LocalReport();
            this._oInforme.ReportPath = poInforme.Ubicacion + poInforme.Nombre + "." + poInforme.Extension;

            foreach (DataTable oTabla in poFuenteDatos.Tables)
            {
                this._oInforme.DataSources.Add(new ReportDataSource(oTabla.TableName, oTabla));
            }
        }
コード例 #4
0
ファイル: InformeWeb.cs プロジェクト: MH3Dapesa/Dapesa
        internal InformeWeb(Entidades.Informe poInforme, DataSet poFuenteDatos)
            : base(poInforme)
        {
            this._oInforme            = new LocalReport();
            this._oInforme.ReportPath = poInforme.Ubicacion + poInforme.Nombre + "." + poInforme.Extension;

            //Agregado el 29/08/2015
            //if(poInforme.Parametros.Length>0)
            //{
            //    //ReportParameter[] parametro = new ReportParameter[poInforme.Parametros.Length];
            //    ////this._oInforme.SetParameters((ReportParameter[])poInforme.Parametros);
            //    this._oInforme.SetParameters(poInforme.Parametros);
            //}

            foreach (DataTable oTabla in poFuenteDatos.Tables)
            {
                this._oInforme.DataSources.Add(new ReportDataSource(oTabla.TableName, oTabla));
            }
        }