Foros del Web » Programando para Internet » PHP »

reporte en pdf con fpdf-ayuda

Estas en el tema de reporte en pdf con fpdf-ayuda en el foro de PHP en Foros del Web. Código PHP: //set initial y axis position per page $y_axis_initial  =  25 ; //print column titles $pdf -> SetFillColor ( 116 , 219 , 253 ); $pdf -> SetFont ( 'Arial' , 'B' ...
  #1 (permalink)  
Antiguo 18/01/2011, 16:43
xol
 
Fecha de Ingreso: enero-2011
Mensajes: 5
Antigüedad: 13 años, 3 meses
Puntos: 0
Pregunta reporte en pdf con fpdf-ayuda

Código PHP:
//set initial y axis position per page
$y_axis_initial 25;

//print column titles
$pdf->SetFillColor(116,219,253);
$pdf->SetFont('Arial','B',12);
$pdf->SetY($y_axis_initial);
$pdf->SetX(25);
$pdf->Ln(80);
$pdf->Cell(49,6,'INVENTARIO',1,0,'C',1);
$pdf->Cell(49,6,'MARCA',1,0,'C',1);
$pdf->Cell(49,6,'MODELO',1,0,'C',1);
$pdf->Cell(49,6,'SERIE',1,0,'C',1);

$y_axis $y_axis $row_height;

//Select the Products you want to show in your PDF file
$result=mysql_query('select inventario,marca,modelo,serie from inv_total ORDER BY inventario');

//initialize counter
$i 0;

//Set maximum rows per page
$max 20;

//Set Row Height
$row_height 6;

while(
$row mysql_fetch_array($result))
{
//If the current row is the last one, create new page and print column title
if ($i == $max)
{
$pdf->AddPage();

//print column titles for the current page
$pdf->SetY($y_axis_initial);
$pdf->SetX(25);
$pdf->Ln(10);
$pdf->SetFillColor(116,219,253);
$pdf->Cell(49,6,'INVENTARIO',1,0,'C',1);
$pdf->Cell(49,6,'MARCA',1,0,'C',1);
$pdf->Cell(49,6,'MODELO',1,0,'C',1);
$pdf->Cell(49,6,'SERIE',1,0,'C',1);

//Go to next row
$y_axis $y_axis $row_height;

//Set $i variable to 0 (first row)
$i 0;

}

$pdf->SetFillColor(255,255,255);

$in $row['inventario'];
$ma $row['marca'];
$mo $row['modelo'];
$sr $row['serie'];

$pdf->SetFont('Arial','',12);
$pdf->SetY($y_axis);
$pdf->SetX(25);
$pdf->Ln(112);
$pdf->Cell(49,5,$in,1,0,'L',1);
$pdf->Cell(49,5,$ma,1,0,'C',1);
$pdf->Cell(49,5,$mo,1,0,'C',1);
$pdf->Cell(49,5,$sr,1,0,'C',1);
//Go to next row
$y_axis $y_axis $row_height;
$i $i 1;
}

mysql_close;

//Send file
$pdf->Output(); 
imagen 1

imagen 2
  #2 (permalink)  
Antiguo 18/01/2011, 16:58
xol
 
Fecha de Ingreso: enero-2011
Mensajes: 5
Antigüedad: 13 años, 3 meses
Puntos: 0
Respuesta: reporte en pdf con fpdf-ayuda

tengo el siguiente problema... estoy elaborando un reporte en pdf.... para lo cual ya lo hace pero tengo un problema debido a que se indica en el codigo que solo me ponga hasta 20 registros maximo por pagina si me lo hace pro en la primera pagina, ya que pasa a la segunda tambien me pone los datos pero el problema es que me los empieza a pponer desde abajo y no me los pone al iniciar la pagina....

Etiquetas: pdf, reporte
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 18:32.