PHP - REPORTES PDF

 
Vista:

REPORTES PDF

Publicado por zendi (16 intervenciones) el 25/02/2010 14:05:09
ME ESTOY INICIANDO CON LOS REPORTES PDF, Y QUISIERA SABER COMO IMPRIMIR UNA VARIABLE Y NO HE PODIDO AUN, SOLO IMPRIME LA IMAGEN QUE ESTA EN EL HEADER, PERO LAS VARIABLES QUE SE ENCUENTRAN EL EN WHILE NO SE IMPRIMEN.
SERA QUE FALTA ALGO? NO IMPRIME LA VARIABLE $txt NI $nombres. SI ALGUIEN PUDIERA DARME UNA AYUDA. GRACIAS
ESTE ES EL CODIGO.

<?php
$conexion = pg_connect("host=localhost port=5432 dbname=administracion user=postgres password=xxxx");
define('FPDF_FONTPATH','./PDF/font/');
require('./PDF/WriteTag.php');
class PDF extends PDF_WriteTag
{
//Cabecera de página
function Header()
{
//Logo
$this->Image('imagenes/dibujo.JPG',15,10,185,40);
//Arial bold 15
$this->SetFont('Arial','B',15);
}

//Pie de página
function Footer()
{
//Posición: a 1,5 cm del final
$this->SetY(-20);
//Arial italic 8
$this->SetFont('Arial','I',8);
//Número de página
$this->Cell(0,10,'Pag '.$this->PageNo().'/{nb}',0,0,'C');
}

}//--Fin de la Clase

//Creación del objeto de la clase heredada
$pdf=new PDF('P','mm','Letter');
$recibo = "SELECT * FROM vrecibo";
$seleccionados = @pg_query($connect,$recibo);
$pdf->AddPage();

while($select2 = @pg_fetch_array($seleccionados)):
$nombres = $select2['nombres'];
$cedula = $select2['cedula'];
$descripcion = $select2['descripcion'];
$txt="RECIBO";
$pdf->Cell(20,4,$txt,0,0,'C');
$pdf->SetXY(30,10);
$pdf->Cell(50,4,$nombres,0,0,'L');
$pdf->Ln(15);
endwhile;
$pdf->Output('prueba','I');
$pdf->Close();
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder