Ver Mensaje Individual
  #1 (permalink)  
Antiguo 30/01/2017, 06:15
andres18281
 
Fecha de Ingreso: febrero-2013
Ubicación: Cali Colombia
Mensajes: 118
Antigüedad: 11 años, 2 meses
Puntos: 0
fpdf problemas al generar tablas y salto de pagina

Buenas comunidad.

Al generar un bucle para llenar unas tablas, observo que desde que inicia el foreach recorriendo los arreglos genera bien cada columna y fila con el fpdf, al hacer el salto de hoja observo que cada registro del arreglo hace un salto de hoja, un comportamiento bastante extraño, lo correcto seria que generara las columnas y filas organizadamente.

Como se observa cuando se crea la tabla


Como se ve cuando hace el salto de hoja para continuar


Esta es la funcion que uso para generar las tablas.
Lo curioso es que llega hasta una parte de una hoja donde imprime correctamente.

Les agradesco la ayuda, esto me esta generando molestias y llevo dias sin resolverlo.
Gracias
Código PHP:
function TablaEnsayos($data){
  
$this->SetFont('Helvetica''b'7);
  
$col $this->getX();
  
$y $this->GetY();
  
$this->SetXY(20,$y);
  
$this->Cell(10,15,"",1,1,"",false);
  
$this->SetXY(20,$y);
  
$this->Multicell(10,3,"Muestra \n No.",0,'C');
  
$this->SetXY(30,$y);
  
$this->Cell(15,15,"",1,1,"",false);
  
$this->SetXY(30,$y);
  
$this->Multicell(15,3,"Localizacion \n(Elemento a \n fundir)",0,'C');
  
$this->SetXY(45,$y);
  
$this->Cell(10,15,"",1,1,"",false);
  
$this->SetXY(45,$y);
  
$this->Multicell(10,3,"f'c kg/cm2",0,'C');
  
$this->SetXY(55,$y);
  
$this->Cell(15,15,"",1,1,"",false);
  
$this->SetXY(55,$y);
  
$this->Multicell(15,3,"Fecha \n Fundicion \n(DD/MM/AA)",0,'C');
  
$this->SetXY(70,$y);
  
$this->Cell(10,15,"",1,1,"",false);
  
$this->setXY(70,$y);
  
$this->Multicell(10,3,"fc 7 \n días kg/cm2",0,'C');
  
$this->SetXY(80,$y);
  
$this->Cell(10,15,"",1,1,"",false);
  
$this->SetXY(80,$y);
  
$this->Multicell(10,3,"% f'c",0,'C');
  
$this->SetXY(90,$y);
  
$this->Cell(10,15,"",1,1,"",false);
  
$this->SetXY(90,$y);
  
$this->Multicell(10,3,"fc 14 \n días kg/cm2",0,'C');
  
$this->SetXY(100,$y);
  
$this->Cell(10,15,"",1,1,"",false);
  
$this->SetXY(100,$y);
  
$this->Multicell(10,3,"% f'c",0,'C');
  
$this->SetXY(110,$y);
  
$this->Cell(10,15,"",1,1,"",false);
  
$this->SetXY(110,$y);
  
$this->Multicell(10,3,"fc 28 \n días kg/cm2",0,'C');
  
$this->SetXY(120,$y);
  
$this->Cell(10,15,"",1,1,"",false);
  
$this->SetXY(120,$y);
  
$this->Multicell(10,3,"% f'c",0,'C');
  
$this->SetXY(130,$y);
  
$this->Cell(10,15,"",1,1,"",false);
  
$this->SetXY(130,$y);
  
$this->Multicell(10,3,"fc 56 \ndías kg/cm2",0,'C');
  
$this->SetXY(140,$y);
  
$this->Cell(10,15,"",1,1,"",false);
  
$this->SetXY(140,$y);
  
$this->Multicell(10,3,"%f'c",0,'C');
  
$this->SetXY(150,$y);
  
$this->Cell(10,15,"",1,1,"",false);
  
$this->SetXY(150,$y);
  
$this->Multicell(10,3,"fc 100 \ndías kg/cm2",0,'C');
  
$this->SetXY(160,$y);
  
$this->Cell(10,15,"",1,1,"",false);
  
$this->SetXY(160,$y);
  
$this->Multicell(10,3,"%f'c",0,'C');
  
$this->SetFont('Helvetica''b'7);
  
$this->SetXY(170,$y);
  
$this->Cell(20,15,"",1,1,"",false);
  
$this->SetXY(170,$y);
  
$this->Multicell(20,3,"ACCION CORRECTIVA",0,'C');
  
$this->SetXY(20,$y);
  
$this->Cell(20,15,"",0,1,"",false);
  if(isset(
$data) and is_array($data)){
   
  foreach(
$data as $value){
   if(isset(
$value) and is_array($value)){
    
$y $this->getY();
    
$this->setXY(20,$y);
    
$this->Cell(10,15,"",1,1,"",false);
    
$this->setXY(20,$y);
    
$this->Multicell(10,3,$value['muest_no'],0,'C');
    
$this->setXY(30,$y);
    
$this->Cell(15,15,"",1,1,"",false);
    
$this->setXY(30,$y);
    
$this->Multicell(15,3,$value['muest_locali'],0,'C');
    
$this->setXY(45,$y);
    
$this->Cell(10,15,"",1,1,"",false);
    
$this->setXY(45,$y);
    
$this->Multicell(10,3,$value['muest_fc'],0,'C');
    
$this->setXY(55,$y);
    
$this->Cell(15,15,"",1,1,"",false);
    
$this->setXY(55,$y);
    
$this->Multicell(15,3,$value['muest_fech'],0,'C');
    
$this->setXY(70,$y);
    
$this->Cell(10,15,"",1,1,"",false);
    
$this->setXY(70,$y);
    
$this->Multicell(10,3,$value['muest_fc_07'],0,'C');
    
$this->setXY(80,$y);
    
$this->Cell(10,15,"",1,1,"",false);
    
$this->setXY(80,$y);
    
$this->Multicell(10,3,$value['muest_fc_porcen'],0,'C');
    
$this->setXY(90,$y);
    
$this->Cell(10,15,"",1,1,"",false);
    
$this->setXY(90,$y);
    
$this->Multicell(10,3,$value['muest_fc_14'],0,'C');
    
$this->setXY(100,$y);
    
$this->Cell(10,15,"",1,1,"",false);
    
$this->setXY(100,$y);
    
$this->Multicell(10,3,$value['muest_fc_2'],0,'C');
    
$this->setXY(110,$y);
    
$this->Cell(10,15,"",1,1,"",false);
    
$this->setXY(110,$y);
    
$this->Multicell(10,3,$value['muest_fc_28'],0,'C');
    
$this->setXY(120,$y);
    
$this->Cell(10,15,"",1,1,"",false);
    
$this->setXY(120,$y);
    
$this->Multicell(10,3,$value['muest_fc_3'],0,'C');
    
$this->setXY(130,$y);
    
$this->Cell(10,15,"",1,1,"",false);
    
$this->setXY(130,$y);
    
$this->Multicell(10,3,$value['muest_fc_56'],0,'C');
    
$this->setXY(140,$y);
    
$this->Cell(10,15,"",1,1,"",false);
    
$this->setXY(140,$y);
    
$this->Multicell(10,3,$value['muest_fc_4'],0,'C');
    
$this->setXY(150,$y);
    
$this->Cell(10,15,"",1,1,"",false);
    
$this->setXY(150,$y);
    
$this->Multicell(10,3,$value['muest_fc_100'],0,'C');
    
$this->setXY(160,$y);
    
$this->Cell(10,15,"",1,1,"",false);
    
$this->setXY(160,$y);
    
$this->Multicell(10,3,$value['muest_fc_5'],0,'C');
    
$this->SetFont('Helvetica''b'7);
    
$this->setXY(170,$y);
    
$this->Cell(20,15,"",1,1,"",false);
    
$this->setXY(170,$y);
    
$this->Multicell(20,3,$value['muest_accion_correct'],0,'C');
   }
   }
  }