PHP - reportes en PDF

 
Vista:

reportes en PDF

Publicado por zendi (16 intervenciones) el 17/02/2010 16:00:38
ME ESTOY INICIANDO 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 LO HACE.
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

RE:reportes en PDF

Publicado por Jorge Luis (2 intervenciones) el 17/02/2010 17:15:59
Prueba a sustituir el while por esto:

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,1,'L');
}
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:reportes en PDF

Publicado por zendi (16 intervenciones) el 17/02/2010 21:04:36
QUE TAL JORGE LUIS, LO HICE TAL COMO ME INDICASTE PERO SIGUE IGUAL, NO LOS IMPRIME. SERA QUE FALTA UN DETALLE QUE NO VEMOS?

SALUDOS.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar