2

I am trying to use Symfony2 how can I export an html table to an Excel file with php who can help me

2 Answers 2

3

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.

Sign up to request clarification or add additional context in comments.

2 Comments

hello I used this method to export a table I'm displaying the content but not much I have, as séparteur: (
$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');
2

Try PHPExcel. It has support for most of the frequently used Excel features.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.