Ver Mensaje Individual
  #1 (permalink)  
Antiguo 23/09/2011, 10:38
Avatar de stuart_david3
stuart_david3
 
Fecha de Ingreso: agosto-2011
Mensajes: 215
Antigüedad: 12 años, 8 meses
Puntos: 1
Sonrisa Problema al Cargar muchos registros en PDF con PHP!!!...

Buen día a todos!!! Pues tengo una gran duda... Verán, eh estado haciendo un proyecto, y batallaba con para generar PDF's en base a consultas de mysql con PHP, en fin gracias a Dios si me ha salido esto, solo hay un detalle que no se como resolver... Al generar mi PDF en el siguiente código:

Código PHP:
Ver original
  1. <?php
  2. error_reporting(E_ALL & ~E_NOTICE);
  3. require_once('class.ezpdf.php');
  4.  
  5.         $trabajador=$_POST['RPEREGASIS'];
  6.  
  7.         $conectar=mysql_connect('localhost','root','');
  8.         if($conectar==NULL)
  9.         {
  10.             printf("Error al conectar a la Base de datos");
  11.         }
  12.  
  13. $pdf =& new Cezpdf('LETTER','landscape');
  14. $pdf->selectFont('../fonts/php_Times-Roman.afm');
  15. $pdf->ezSetCmMargins(1,1,1.5,1.5);
  16. $pdf->ezSetMargins(40,45,30,30);
  17. $pdf->ezStartPageNumbers(750,25,12,'','{PAGENUM} de {TOTALPAGENUM}',1);
  18.         $resultado=mysql_query("SELECT RPEREGASIS, FECREGASIS, MIN(HORREGASIS) AS entrada, MAX(HORREGASIS) as salida
  19.        FROM registro WHERE RPEREGASIS='$trabajador' GROUP BY RPEREGASIS, FECREGASIS");
  20.  
  21. $totEmp = mysql_num_rows($resultado);
  22. if($row=mysql_fetch_array($resultado)){
  23. $ixx = 0;
  24. while($datatmp = mysql_fetch_assoc($resultado)) {
  25.     $ixx = $ixx+1;
  26.     $data[] = array_merge($datatmp, array('id'=>$ixx));
  27. }
  28. $titles = array(
  29.                 'id'=>'<b>Id</b>',
  30.                 'RPEREGASIS'=>'<b>RPE del Empleado</b>',
  31.                 'FECREGASIS'=>'<b>Fecha</b>',
  32.                 'entrada'=>'<b>Hora de Entrada</b>',
  33.                 'salida'=>'<b>Hora de Salida</b>'
  34. );
  35. $options = array(
  36.                 'shadeCol'=>array(0.9,0.9,0.9),
  37.                 'xOrientation'=>'center',
  38.         'fontSize'=>8,
  39.                 'width'=>700,
  40.         'colGap'=>2,
  41.                 'xPos'=>'centre',
  42. );
  43. $pdf->addJpegFromFile("cfep.jpg",680,533,60,60);
  44. $txttit.= mb_convert_encoding("<b>                                                                                                       Reporte:</b>\n", 'ISO-8859-1', 'UTF-8');
  45. $txttit.= "                                                                                          Asistencia de Empleados \n";
  46. $pdf->ezText($txttit, 12);
  47. $pdf->ezText($data, 12);
  48. $pdf->ezTable($data, $titles, '', $options);
  49. $pdf->ezText("\n\n\n", 10);
  50. $pdf->ezText("<b>Fecha:</b> ".date("d/m/Y"), 10);
  51. $pdf->ezText("<b>Hora:</b> ".date("H:i:s")."\n\n", 10);
  52. $pdf->ezStream();
  53. }
  54.  
  55. else{
  56. header("Location: PDFDefault.php");
  57. }
  58. ?>
  59. </body>
  60. </html>

Pues si me genera el PDF con los resultados de la consulta cuando Limito en la consulta hasta el regustro 24:
----> ...FECREGASIS LIMIT 1,24");

A partir del 25 me marca error al cargar el PDF ... y sinceramente no se por qué :s...

De antemano agradezco su ayuda, y mil disculpas por tantas molestias...

Última edición por stuart_david3; 23/09/2011 a las 12:20