Page 1 of 1
PHP/HTML - Export to Excel
Posted: Tue Nov 10, 2009 8:48 am
by koolsamule
Hi Chaps,
I have a HTML table, and need to export the contents, with formatting to MS Excel.
Does anyone know of a simple way to do this?
Re: PHP/HTML - Export to Excel
Posted: Tue Nov 10, 2009 9:10 am
by papa
Re: PHP/HTML - Export to Excel
Posted: Tue Nov 10, 2009 9:13 am
by koolsamule
I've tried that dude, came across PHPExcel classes, but haven't got a clue how to incorporate them into my existing web app. . . .that's why I'm asking for help. . . .
Re: PHP/HTML - Export to Excel
Posted: Tue Nov 10, 2009 9:43 am
by papa
Well taking existing code and implement it is a simple way of doing it. An even simpler way would be to pay someone to do it for you.
Re: PHP/HTML - Export to Excel
Posted: Tue Nov 10, 2009 10:10 am
by koolsamule
uhh....not really what i'm after, would like to know how to do it myself, rather than pay someone to do it.
Re: PHP/HTML - Export to Excel
Posted: Tue Nov 10, 2009 11:31 am
by socalocmatt
I have also been interested in working with this class. I haven't come across a project where I need to use it... yet. I do have their documentation on it:
http://phpexcel.codeplex.com/Release/Pr ... adId=90450
but I have yet to pour over it all and test any type of implementation.
I'm pretty sure that if the solution for every problem was "pay someone else to do it", this forum, and others, would be pretty dead. People are here to learn from one another and not have the answer be "pay someone to do it". Just MO.
Re: PHP/HTML - Export to Excel
Posted: Tue Nov 10, 2009 3:15 pm
by Mark Baker
If you're building the HTML from XML/database/array data, then you can just as readily update PHPExcel cells with that information, and then set cell stylings before writing it to xls.
Simply include the library, and instantiate a PHPExcel object. Then you can loop through your data, writing to each row of a worksheet.
There's plenty of examples showing how to populate and format cells in the PHPExcel Tests directory
Re: PHP/HTML - Export to Excel
Posted: Tue Nov 10, 2009 5:03 pm
by jaywebguy
How about outputting the header info as an cvx or xls file.
Here:
http://www.modwest.com/help/kb6-135.html
Re: PHP/HTML - Export to Excel
Posted: Tue Nov 10, 2009 5:24 pm
by Mark Baker
jaywebguy wrote:How about outputting the header info as an cvx or xls file.
Simply setting the headers to pretend that it's an xls file doesn't make it one.
And the OP wants the formatting as well as the data - so it needs to be the real thing