Ver Mensaje Individual
  #1 (permalink)  
Antiguo 07/02/2012, 09:00
Avatar de 8461277
8461277
 
Fecha de Ingreso: diciembre-2002
Ubicación: san juan de los morros
Mensajes: 887
Antigüedad: 21 años, 5 meses
Puntos: 1
Primera fila, repetir en todas las hojas????

Buenos dias, amigo por aqui de nuevo con una nueva duda, tengo una funcion que me genera una tabla en html, la cula funciona al pelo, el genera un numero de fila de 50 en 50 por cada hoja, pero necesito q la primera fila (encabezado, la cula tiene: Nº, fecha, vaucher/monto y banco) se repita en todas las hojas de acuerdo a la cantidad de registro que quiero imprimir.
Como puedo lograr eso??????
aqui esta la funcion; q ya una perosona aqui en foro creo q GUSTAV me a ayudado armar
Código PHP:
private function generarTablaHTML($fecha_inicial,$fecha_final,$iniciales,$nombre,$valor,$id_usuario){
        
conexion y consulta a la BD..............
        
        
$tablaHTML '<table style="text-align: center; width: 460px; " border="1" cellspacing="0" cellpadding="0">
                              <tr>
                                  <td style=" text-align: center; width:50;">Nº</td>
        ENCABEZADO->  <td style=" text-align: center;">Fecha Deposito</td>
                                  <td style=" text-align: center;">Vaucher / Monto</td>
                                  <td style=" text-align: center; width:220;">Banco</td>
                            </tr>'
;
                
$numLinea=1;
                
$totdep=0;
                
$totdep2=0;
        foreach(
$enter_fechas as $datofecha ){
                    if(
$totdep==0) {
                        
$fecha=$datofecha['Fechadeposito']['fecha'];
                    }
                
$fecha_espa=date("d-m-Y",strtotime($datofecha['Fechadeposito']['fecha']));
                            
                        
$depo=$datofecha['Bauche'];
                        
$monto=number_format($depo['monto'],2,',''.');
                       
        
$tablaHTML .= '<tr>
                           <td style=" text-align: center; width:50;">' 
$numLinea'</td>
                           <td style=" text-align: center;">' 
$fecha_espa'</td>
                           <td><table border="1"><tr><td style=" text-align: center;">' 
$depo['num_bauche'] .'</td><td style=" text-align: right;">'.$monto.'</td></tr></table></td>';
                           
$totdep $totdep $depo['monto'];
                           
$totdep2 $totdep2 $depo['monto'];
                           
        
$tablaHTML .= '<td style=" text-align: center; width:220;">'.$datofecha['Banco']['agencia'].'</td></tr>';
        
$numLinea++;
        
            
//if($fecha != $datofecha['Fechadeposito']['fecha']) {
         //if($numLinea>50) {
       
if (($numLinea 51) == 0) {  
           
$fecha=$datofecha['Fechadeposito']['fecha'];
           
$tablaHTML .= '<tr><td ></td><td></td><td></td><td style="width:155;"><b>SUBTOTAL='.number_format($totdep,2,',''.').' Bs.</b></td></tr>';
           
$totdep=0;
           }
//if($fecha != $datofecha['Fechadeposito']['fecha'])
                    
       
        
}//fin del primer foreach foreach($datosFecha as $datofecha )
        
if($totdep<0) {
            
$tablaHTML .= '<tr><td></td><td></td><td></td><td><b>SUBTOTAL='.number_format($totdep,2,',''.').' Bs.<b></td></tr>';
        }
        if(
$totdep2>0) {
            
$tablaHTML .='<tr><td></td><td></td><td></td><td style="width:155;"><b>TOTAL='.number_format($totdep2,2,',''.').' Bs.</b></td></tr>';
        }
        
$tablaHTML .= '</table>';
        
$TOTAL=$totdep2;
        
$totalLetras=$this->num2letras(number_format($totdep2,2,'.',''));
        
        return array(
$tablaHTML,$TOTAL,$totalLetras,$fecha_final,$bancoid);
      }
    }
//fin function generarTablaHTML($fecha_inicial,$fecha_final) 
__________________
Miguel Padrón :cool: