Reading and Writing Excel Files with PHP

  • devilwood
  • Silver Member
  • Silver Member
  • User avatar
  • Posts: 436

Post 3+ Months Ago

I have an excel spreadsheet template that the guys in the office use as a communications log. I opened the template with excel and saved the XML. So this is good, right? All I have to do is echo my content (new communications) in the appropriate places within the excelXML and display. The supervisor then can just read the communications, save, or display later (saving the xml in a table). Well, I'm having difficulties displaying the raw excelXML so that it looks like a spreadsheet in the browser window kinda like a google spreadsheet doc. I want the supervisor to be able to view the spreadsheet (with all it's colors, etc) in the browser window without having to open MSExcel because also I want him to be able to query the db if he wants past communication's xml stored in the database. What do I need to look into as far as parsing the XML to the browser and having it look like a spreadsheet?
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • effim
  • Beginner
  • Beginner
  • User avatar
  • Posts: 35
  • Loc: Austin, TX

Post 3+ Months Ago

You can parse the XML really easily with, as the name implies, SimpleXML.

http://us.php.net/simplexml

You should probably try to properly format your post into a more coherent explanation of the current setting, the problem, and what your question is. Right now it's a bit of a confusing blob of text.
  • Bogey
  • Genius
  • Genius
  • Bogey
  • Posts: 8388
  • Loc: USA

Post 3+ Months Ago

effim wrote:
...confusing blob of text.

Image


Anyway, what effim said :lol: I don't really have much to add other than that image above of some 60's (I believe) video cover of The Blob
  • devilwood
  • Silver Member
  • Silver Member
  • User avatar
  • Posts: 436

Post 3+ Months Ago

Ok fellas,

I saved an excel spreadsheet in it's XML format. Of course, if I open that file with Excel it will display the rows and columns as it normally would, but if I open that file in IE I get the raw XML. I want to be able to view the XML in a browser window and have it display the spreadsheet. I was just trying to get around having to parse all the nodes myself and figured there had to be something that recognized the excel XML schema and automatically put it into it's spreadsheet equivalent when displayed in IE.

the blob bit was hilarious. I lmao.

I hope this makes it easier, but I'm probably looking at having to use simpleXML and just parse the nodes myself and put in table cells. So, really

Is there a parser that will automatically parse excel generated XML and display the spreadsheet equivalent in a browser window?
  • spork
  • Brewmaster
  • Silver Member
  • User avatar
  • Posts: 6251
  • Loc: Seattle, WA

Post 3+ Months Ago

I'd look into using XSLT, the entire purpose of which is to transform one XML document into another. In this case, you'd want to transform your Excel XML into XHTML.

http://www.w3schools.com/xsl/
  • devilwood
  • Silver Member
  • Silver Member
  • User avatar
  • Posts: 436

Post 3+ Months Ago

Thanks spork,

That is what I've been looking at, but I didn't want to get all the way into something and it be wrong.

So, if someone comes across an easy method to display an excel spreadsheet inside a browser window then please post. Otherwise, I've got tons to look at between parsing the XML with simpleXML and/or using XSLT.

I'll post what I come up with.
  • Bogey
  • Genius
  • Genius
  • Bogey
  • Posts: 8388
  • Loc: USA

Post 3+ Months Ago

I recommend you use XSL... your second post here made more sense to me and I was going to suggest XSL until I saw spork's post... now I'm just confirming what he suggested.

Post Information

  • Total Posts in this topic: 7 posts
  • Users browsing this forum: No registered users and 78 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.