Forums: Front End:

 

php to xls?

first
 

ernieweaselfat php to xls?

I need to use php to change an html table to an MS excel document. Is it possible?

anybody have a good tutorial or (free or low-cost) solution?

Thanks!

 

Tha.Riddla

you can open .html files in excel....table cells/rows/columns convert. or did you need something very specific?

 

Stickman

XLS Reader -- costs US$67.
xls2mysql -- costs $15, converts to MySQL but you could either hack that bit out or just export from MySQL to HTML afterwards

StickBlog - random developer stuff
quote
 

ernieweaselfat

Originally posted by: Stickman
XLS Reader -- costs US$67.
xls2mysql -- costs $15, converts to MySQL but you could either hack that bit out or just export from MySQL to HTML afterwards


I actually want to go the other way php --> xls. I found that xls generator one before (the same company that makes xls reader), have you used it, Stick? I just want to make sure it works before I buy it...

 

Stickman

Ah..oops. I blame the drugs I'm on for this stupid cold, I feel like I have a head full of sawdust.

No I haven't tried it, sorry. I just Googled. shrug.gif

StickBlog - random developer stuff
quote
 

ShEx

I've used the pear one before, there's an article on it here

 

ernieweaselfat

Originally posted by: ShEx
I've used the pear one before, there's an article on it here


cool, thanks, ShEx.

 

scudsucker

Just set the mime type and spit out the HTML page- Excel will recognise it as an XLS:


header('Content-type: application/vnd.ms-excel');


If you want to force a download (rather than have IE open it in the browser) add


header('Content-Disposition: attachment; filename="ExcelDoc.xls"');


 

poliguin

the one caveat with that is it depends on the type of document reader you have. In open office it will open it as a html document in calc and you won't have the same functionality as you would normally expect in an excel document. Microsoft Excel doesn't have a problem with it.

I haven't tried others.

With that said, the best solution I've found cross different excel readers is to us the XML format. As far as I've noticed the readers use the Microsoft Excel format (or at least recognize it).

blogs.msdn.com/brian_jones/archive/category/10277.aspx

It can be a little annoying to debug though. If there are errors with the client they will get an alert saying that there was some sort of error in some temporary document. You will need this document in order to track down the error (if you can't reproduce it yourself).

It will require open office or MS Excel 2003+.

var _oRLY = {HAI:function(){return this.KTHXBYE(); },KTHXBYE:function(){ return this.HAI();},init:function(){ this.HAI()};_oRLY.init()?'YARLY':'NOWAI';
quote
 
first
 

Forums: Front End: php to xls?

 
New Post
 
You must be logged in to post