function vista_excel(toba_vista_excel $salida)
 {
     $this->totalizar_columnas_impresion();
     $formateo = new $this->_clase_formateo('excel');
     $opciones = array();
     $datos = array();
     if (isset($this->_ordenes)) {
         //--Titulos
         $titulos = array();
         foreach ($this->_lista_ef_post as $ef) {
             $titulos[$ef] = $this->ef($ef)->get_etiqueta();
         }
         //--Datos
         foreach ($this->_ordenes as $fila) {
             $dato = $this->_datos[$fila];
             $this->cargar_registro_a_ef($fila, $dato);
             $this->_carga_opciones_ef->cargar();
             $datos_temp = array();
             foreach ($this->_lista_ef_post as $ef) {
                 $this->_elemento_formulario[$ef]->ir_a_fila($fila);
                 if (isset($this->_info_formulario_ef[$ef]["formateo"])) {
                     $funcion = "formato_" . $this->_info_formulario_ef[$ef]["formateo"];
                     $valor_real = $this->_elemento_formulario[$ef]->get_estado();
                     list($valor, $estilo) = $formateo->{$funcion}($valor_real);
                 } else {
                     list($valor, $estilo) = $this->_elemento_formulario[$ef]->get_descripcion_estado('excel');
                 }
                 if (isset($estilo)) {
                     $opciones[$ef]['estilo'] = $estilo;
                 }
                 $opciones[$ef]['ancho'] = 'auto';
                 $datos_temp[$ef] = $valor;
             }
             $datos[] = $datos_temp;
         }
         $salida->tabla($datos, $titulos, $opciones);
     }
 }
Exemple #2
0
 function vista_excel(toba_vista_excel $salida)
 {
     $this->_carga_opciones_ef->cargar();
     $formateo = new $this->_clase_formateo('excel');
     $datos = array();
     foreach ($this->_lista_ef_post as $ef) {
         $opciones = array();
         $etiqueta = $this->_elemento_formulario[$ef]->get_etiqueta();
         //Hay que formatear?
         $estilo = array();
         if (isset($this->_info_formulario_ef[$ef]["formateo"])) {
             $funcion = "formato_" . $this->_info_formulario_ef[$ef]["formateo"];
             $valor_real = $this->_elemento_formulario[$ef]->get_estado();
             list($valor, $estilo) = $formateo->{$funcion}($valor_real);
         } else {
             list($valor, $estilo) = $this->_elemento_formulario[$ef]->get_descripcion_estado('excel');
         }
         if (isset($estilo)) {
             $opciones['valor']['estilo'] = $estilo;
         }
         $opciones['etiqueta']['estilo']['font']['bold'] = true;
         $opciones['etiqueta']['ancho'] = 'auto';
         $opciones['valor']['ancho'] = 'auto';
         $datos = array(array('etiqueta' => $etiqueta, 'valor' => $valor));
         $salida->tabla($datos, array(), $opciones);
     }
 }
Exemple #3
0
 function vista_excel(toba_vista_excel $salida)
 {
     $this->_carga_opciones_ef->cargar();
     $formateo = new $this->_clase_formateo('excel');
     $datos = array();
     foreach ($this->_columnas as $columna) {
         if (!$columna->es_visible()) {
             continue;
         }
         if ($columna->get_ef()->tiene_estado()) {
             $opciones = array();
             $etiqueta = $columna->get_ef()->get_etiqueta();
             //Hay que formatear?
             $estilo = array();
             $fn_formateo = $columna->get_formateo();
             if (!is_null($fn_formateo)) {
                 $funcion = "formato_" . $fn_formateo;
                 $valor_real = $columna->get_ef()->get_estado();
                 list($valor, $estilo) = $formateo->{$funcion}($valor_real);
             } else {
                 list($valor, $estilo) = $columna->get_ef()->get_descripcion_estado('excel');
             }
             $condicion = $columna->condicion()->get_etiqueta();
             if (isset($estilo)) {
                 $opciones['valor']['estilo'] = $estilo;
             }
             $opciones['etiqueta']['estilo']['font']['bold'] = true;
             $opciones['etiqueta']['ancho'] = 'auto';
             $opciones['condicion']['ancho'] = 'auto';
             $opciones['valor']['ancho'] = 'auto';
             $datos = array(array('etiqueta' => $etiqueta, 'condicion' => $condicion, 'valor' => $valor));
             $salida->tabla($datos, array(), $opciones);
         }
     }
 }