Report generation in PHP (formats required pdf,xls,doc,csv)

这一生的挚爱 提交于 2019-12-03 08:52:00

问题


I need to generate reports in my PHP website (in zend framework)

Formats required:

PDF (with tables & images) // presently using Zend_Pdf
XLS (with tables & images)
DOC (with tables & images)
CSV (only tables)

Please recommend robust and fast solution for generating reports in PHP.

Platform: Zend Framework on LAMP

I know there are some tricky solutions for creating such reports, i wonder is there any open source report generation utility that can be used with LAMP environment


回答1:


Excel: http://www.phpexcel.net




回答2:


In my LAMP based application, I integrated the ability to generate report with JasperReports successfully.

For that, I use PHP/Java Bridge to communicate with Jasper java classes. You might want to try Zend Server since it provide this component at installation time.

Check this blog, it was a source of inspiration for my final solution : http://www.rjohnson.id.au/wordpress/2007/10/27/bullet-proof-jasper-reports-and-php/




回答3:


I'm assuming you mean CSV instead of CVS. For excel and csv files, you can use

header("Content-Type: text/comma-seperated-values");
header("Content-Disposition: inline; filename=\"file.csv";");

and

header("Content-Type: application/vnd.ms-excel");
header("Content-Disposition: inline; filename=\"file.xls";")

respectively. Make sure you turn all formatting off and output only values and comma's for the CSV format, and with the XLS format, you can use regular html tables.



来源:https://stackoverflow.com/questions/862607/report-generation-in-php-formats-required-pdf-xls-doc-csv

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!