Report generation in PHP (formats required pdf,xls

2019-03-11 19:57发布

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

3条回答
不美不萌又怎样
2楼-- · 2019-03-11 20:26

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.

查看更多
The star\"
4楼-- · 2019-03-11 20:35

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/

查看更多
登录 后发表回答