2015-01-15 38 views
0

我试图出口使用IO TCPDF PDF(我使用的Symfony 2),但是当数据我尝试出口量超过650行,我收到此错误信息:IO_TCPDF代的最大极限

"Fatal error: Maximum execution time of 30 seconds exceeded in /var/www/html/AiresProxyAudit/vendor/tcpdf/tcpdf.php on line 23099" 

我更改这些变量的值memory_limitmax_execution_time以增加我可以导出的数据量,但每次都发生相同。我究竟做错了什么?这是我的代码。感谢 ,并希望你们能帮助我解决这个问题。 ();} getUserName();}}这个函数可以用来调用getUserName()方法来调用getUserName方法。

$dm = $this->get('doctrine.odm.mongodb.document_manager') 
      ->getRepository('ReportesBundle:RporURL') 
      ->url($this->get_id($usuario,$name)); 

    $totalurls = $this->get('doctrine.odm.mongodb.document_manager') 
      ->getRepository('ReportesBundle:RTotales') 
      ->total($this->get_id($usuario,$name), "url"); 

    $reportes = array(); 
    $totales = array(); 

    foreach ($dm as $value) { 


     $reportes[] = $value; 
    } 

    foreach ($totalurls as $value) { 
     $totales[] = $value; 
    } 

    $html = $this->renderView('ReportesBundle:PDF:pdfurl.pdf.twig', array('reporte' => $reportes, 'totales' => $totales)); 

    //io_tcpdf will returns Response object 
    return $this->get('io_tcpdf')->quick_pdf($html); 
} 

回答

0

我找到了解决它,我分生成PDF到3个模板: $ arrayHtmll =阵列(); ('reportes'=> $ totalRUrl [0],'totales'=> $ totales));} $ html = $ this-> renderView('ReportesBundle:PDF:pdfurl.pdf.twig',array('reporte'=> $ totalRUrl [0]
$ arrayHtmll [] = $ html; ($ index = 1; $ index < count($ totalRUrl)-1; $ index ++){ $ html = $ this-> renderView('ReportesBundle:PDF:pdfurlmedio.pdf.twig',array('reporte' => $ totalRUrl [$ index],'totales'=> $ totales)); // agregue el twig del medio $ arrayHtmll [] = $ html; ('Reporte'=> $ totalRUrl [count($ totalRUrl)-1],'totales'=> $ totales('ReportesBundle:PDF:pdfurlfinal.pdf.twig',array('reporte'=> $ totalRUrl) ));
$ arrayHtmll [] = $ html;

foreach($ arrayHtmll as $ value){ $ fff-> writeHTML($ value,false,false,true,false,'');

我用mongo数据库用26020文档探测它,我没有问题来生成它。我将php文件的变量memory_limit的值更改为256.