Ver Mensaje Individual
  #5 (permalink)  
Antiguo 31/10/2010, 09:32
claudio_hbl
 
Fecha de Ingreso: octubre-2006
Ubicación: Valparaiso Chile
Mensajes: 228
Antigüedad: 17 años, 6 meses
Puntos: 0
Respuesta: Ayuda con FPDF

Gracias nuevamente, por darte el tiempo de explicarme.

Quedo Así y solo muestra una página en blanco

<?php
require('fpdf.php');
require('../clases/conexion.class.php');

$sql='SELECT * FROM empresa';
$res=mysql_query($sql,Conectar::con());

class PDF extends FPDF
{

function FancyTable($header,$data)
{
//Colores, ancho de línea y fuente en negrita
$this->SetFillColor(255,0,0);
$this->SetTextColor(255);
$this->SetDrawColor(128,0,0);
$this->SetLineWidth(.3);
$this->SetFont('','B');
//Cabecera
$w=array(40,35,40,45);
for($i=0;$i<count($header);$i++)
$this->Cell($w[$i],7,$header[$i],1,0,'C',1);
$this->Ln();
//Restauración de colores y fuentes
$this->SetFillColor(224,235,255);
$this->SetTextColor(0);
$this->SetFont('');
//Datos
$fill=false;
while($row=mysql_fetch_assoc($res))
$data[]=array($row);
{
$this->Cell($w[0],6,$row[0],'LR',0,'L',$fill);
$this->Cell($w[1],6,$row[1],'LR',0,'L',$fill);
$this->Cell($w[2],6,$row[2],'LR',0,'L',$fill);
$this->Cell($w[3],6,$row[3],'LR',0,'L',$fill);
$this->Ln();
$fill=!$fill;
}
}
$this->Cell(array_sum($w),0,'','T');
}

$pdf=new PDF();
//Títulos de las columnas
$header=array('ID Empresa','Nombre','Direccion','Telefono');
$pdf->SetFont('Arial','',14);
$pdf->AddPage();
$pdf->FancyTable($header,$data);
$pdf->Output();
?>

Un Cordial saludo
__________________
Un Cordial Saludo
Claudio González Soto
Negocios Online
http;//www.servpcweb.com