3

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

Charles
  • 50,943
  • 13
  • 104
  • 142
Ish
  • 28,486
  • 11
  • 60
  • 77

3 Answers3

9

Excel: http://www.phpexcel.net

Csaba Kétszeri
  • 674
  • 3
  • 6
3

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/

Sylvain
  • 1,518
  • 1
  • 15
  • 15
  • I will certainly re-try implementing JasperReports using Zend Server. thanks for the reply – Ish May 25 '09 at 04:27
  • +1 I have integrated PHP-Jasper over JavaBrige on Apache2 Web Server so as Tomcat, and with no doubt this is a powerful fusion. – Dr Casper Black Nov 11 '10 at 15:54
1

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.

sjobe
  • 2,817
  • 3
  • 24
  • 32
  • This works well with CSV and XLS, but how do i create DOC files ? – Ish May 18 '09 at 05:06
  • DOC files are a little more complicated to do, I am planning on doing something similar with Java and it seems like I'm going to need a library that does the word document creation. You should go on google and see if there are any reasonable libraries that do this in PHP. – sjobe May 19 '09 at 15:00
  • I think **JasperReports** is open source java library that able to do such things in JAVA, I tried it with PHP, but no luck with it. So i used PHP-Excel library and it's good enough for my usability – Ish May 22 '09 at 04:20