News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

InformBank.com:
How to create Microsoft Office documents on the fly using PHP
August 07, 2006 @ 11:57:37

In this new tutorial from InformBank posted today, they show how to use PHP (and a few handy tricks) to create Microsoft Office documents on the fly.

Sometimes you have to generate some MS Office document for the users of your website using dynamic data. For example, few days ago, I had to generate some Excel reports using data from some tables in MySQL. I knew about the COM but it has a lot of disadvantages, including Windows-only platform and not very high speed. CSV is much easier and faster but you can't format the cells to make them better-looking. The method I've never thought about before was using HTML.

So here came the inspiration and after some research and experiments I wrote this tutorial for all of you who are looking how to create Office documents on the fly using PHP. Of course, I included the COM methods and some methods to create other MS Office documents like DOC and PPT, to make this tutorial as full and as useful as possible.

The tutorial starts with the creation of documents (Word, Excel, Powerpoint) with the COM functionality (the standby method PHP has had for a while). Of course, it also requires the script to be running on Windows to work. So, what's the other option? As he goes on to explain, it's something as simple as HTML.

He includes two examples of alternate mathods, showing hhow to use HTML or a CSV file to create a custom Excel document. He also throws in some code to help you stream out the resulting document as a zip file to the browser.

0 comments voice your opinion now!
microsoft document onthefly com extension html csv file microsoft document onthefly com extension html csv file


blog comments powered by Disqus

Similar Posts

JSLabs Blog: Microsoft's PHP initiative

Mike\'s Blog: Hash Extension

Joshua Eichorn's Blog: Understanding AJAX example code now available

Anthony Ferrara: Thoughts On PECL Frameworks

Padraic Brady's Blog: ext/snarl: PHP interface to the Windows Snarl Notification Tool API


Community Events





Don't see your event here?
Let us know!


library list community voicesoftheelephpant install framework tips package podcast introduction release interview bugfix laravel api symfony opinion language series deployment

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework