Export table to excel symfony2
10,006
Solution 1
You can use Symfony2 bundles with such a functionality.
For example: https://github.com/liuggio/ExcelBundle should do.
It provides dependency injection and easy creation of PHPExcel objects. Use composer to manage dependencies and automatically load required libraries.
Solution 2
Try PHPExcel. It has support for most of the frequently used Excel features.
Author by
user1794019
Updated on June 04, 2022Comments
-
user1794019 almost 2 years
I am trying to use Symfony2 how can I export an html table to an Excel file with php who can help me
-
user1794019 over 11 yearshello I used this method to export a table I'm displaying the content but not much I have, as séparteur: (
-
user1794019 over 11 years$filename = "export_".date("Y_m_d").".xls"; $response=$this->render('AdminBlogBundle:GestionAlerte:excel.html.twig', array('listes'=>$listes)); $response->headers->set('Content-Type', 'text/vnd.ms-excel; charset=utf-8'); $response->headers->set('Content-Disposition', 'attachment; filename='.$filename); $response->headers->set('Pragma', 'public'); $response->headers->set('Cache-Control', 'maxage=1');