Ver Mensaje Individual
  #1 (permalink)  
Antiguo 18/04/2016, 16:41
Sparky123
 
Fecha de Ingreso: agosto-2008
Mensajes: 7
Antigüedad: 15 años, 8 meses
Puntos: 0
Reportes en Word con cierta estructura

Buen dia foro.

Tengo una duda, como puedo generar un reporte en word mostrando datos de mysql.

de esta manera la obtengo pero me los genera de forma simple.

Código PHP:
Ver original
  1. header('Content-type: application/vnd.ms-word');
  2.     header("Content-Disposition: attachment; filename=archivo.doc");
  3.     header("Pragma:no-cache");
  4.     header("Expire:0");
  5.  
  6.     echo ("<table border=1>");
  7.     echo ("<tr>");
  8.     echo ("<td colspan='6' bgcolor='skyblue' align='center'>REPORTE DE USUARIOS</td>");
  9.     echo ("</tr>");
  10.  
  11.     echo ("<tr bgcolor='red'>");
  12.     echo ("<td>ID </td>");
  13.     echo ("<td>Correo</td>");
  14.     echo ("<td>Nombre</td>");
  15.     echo ("<td>Password</td>");
  16.     echo ("<td>Nivel</td>");
  17.     echo ("<td>Firma</td>");
  18.     echo ("</tr>");
  19.  
  20.     while ($registro=mysql_fetch_array($r)) {
  21.     echo ("<tr>");
  22.     echo ("<td>$registro[0]</td>");
  23.     echo ("<td>$registro[1]</td>");
  24.     echo ("<td>$registro[2]</td>");
  25.     echo ("<td>$registro[3]</td>");
  26.     echo ("<td>$registro[4]</td>");
  27.     echo ("<td><img src='firmaall.php?n=".$registro['id']."'></td>");
  28.     echo ("</tr>");
  29.        
  30.     }
  31.     echo ("</table>");
  32.  
  33. }else{
  34.     echo ("No hay registros");
  35. }


quiero obtener un reporte personalizado, con imagen de fondo, con contenido de registros de tabla, o tengo que especificar margenes, o alguna libreria.

Espero a verme dado a entender, saludos