views:

2924

answers:

4

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  A: 

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
This works well with CSV and XLS, but how do i create DOC files ?
Ish Kumar
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
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 Kumar
+6  A: 

Excel: http://www.phpexcel.net

Csaba Kétszeri
ahh, that's what i was looking for, tyvm !!!
Ish Kumar
+1  A: 

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
I will certainly re-try implementing JasperReports using Zend Server. thanks for the reply
Ish Kumar
A: 

Check out this guy's solution and code

Conrad