Ver Mensaje Individual
  #6 (permalink)  
Antiguo 11/11/2010, 18:58
elgranjm3000
 
Fecha de Ingreso: agosto-2010
Mensajes: 25
Antigüedad: 13 años, 9 meses
Puntos: 0
Respuesta: Grupos en Fpdf

amigo logre lo queria.. gracias por tu ayuda.. ahora fijate que esto tiene un acumulador de totales.. sera posible que esa variable yo la puedo enviar al pie de pagina¡¡???
Código PHP:
Ver original
  1. <?php
  2. include('conexion.php');
  3. require('fpdf.php');
  4.    
  5.     $pdf=new FPDF('L','mm','A4');
  6.     $pdf->AddPage();
  7.     $pdf->SetFont('Arial','B',8);
  8. $sql = "select DISTINCT  SUBGRUPO from bienes order by SUBGRUPO";  
  9.         $c =     mysql_query($sql);
  10.         while ($r = mysql_fetch_array($c)){
  11.             $valor =  $r['SUBGRUPO'];
  12.  
  13.             $moneda=array($valor);
  14.                 Foreach ($moneda as $clave)
  15.                 {
  16.        
  17.                
  18.                    
  19.                    
  20.                     $total = 0;
  21.                         $sql2 = "select * from bienes WHERE SUBGRUPO = $clave";    
  22.                         $c2 =    mysql_query($sql2);
  23.                         while ($r2 = mysql_fetch_array($c2)){  
  24.                             $pdf->Cell(10,8,$total,0,1);
  25.                             $pdf->Cell(10,8,$r2['SUBGRUPO']);
  26.                             $pdf->Cell(10,8,$r2['VALOR'],0,1);
  27.                             $total = $total + $r2['VALOR'];
  28.            
  29.                             }
  30.                             $pdf->Cell(10,8,$total,0,1);
  31.                                 $pdf->AddPage();
  32.                            
  33.                                 $pdf->Cell(10,8,'HACER UN SALTO: ' . $clave,0,1);          
  34.                            
  35.                
  36.                    
  37.                 }          
  38.             }  
  39.  
  40.  
  41.  
  42.     $pdf->Output();        
  43. ?>