As you may know, PHPExcel is built using an extensible model, supporting different input and output formats. The PHPExcel core class library features a spreadsheet engine, which is supported by IReader and IWriter instances used for reading and writing a spreadsheet to/from a file.
Zero doesn't currently support the COM/.NET extension in PHP.
No matter though, there is a handy open source project called JACOB that bridges between Java and COM/.NET. In fact, there is an easier way to do this using a Groovy library called Scriptom. This is really just a friendly wrapper around JACOB to provide a better syntax for calling methods and accessing properties.
The aim in this example is to list the processes on a Windows machine - here are the steps to do it in PHP. I'm using the latest Zero download of Sebring and Eclipse PDT as the IDE.
A Question of Access
You've already seen, in previous articles, just how easy it is to read and write Microsoft Excel spreadsheets with PHP and PEAR. But spreadsheets are just one way of representing structured data - the other, of course, is to use a database. Well, guess what? If your database happens to be Microsoft Access, PHP has you covered there as well!
In this article, I'll introduce you to PHP's MDBTools extension, which provides an API to programmatically read data from Microsoft Access database files. If your project involves working with such files, extracting database records either for calculations or for conversion to other formats, you'll find this extension invaluable. Come on in, and see how it works!
There is a nice tool for reading Microsoft Excel files called PHPExcelReader. It works with .xls files up to Excel version 2003, which are based on the BIFF format (later versions use OOXML). It is written in native PHP and does not require any third-party libraries or the MS Office package.
In my evening hours, I've been working on a set of PHP classes to create Offixe 2007 SpreasheetML documents (.xlsx files). I finished my first goals (some basic XLSX writing), and I want to share this set of classes to the community.
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.
I have always been surprised from what PHP can do.Using COM objects shows new and best ways for PHP development. The folowing code, which is designed like Step by Step wizard, shows the access to Inbox and Outbox folders in your MS Outlook application.
This week I sat down and focused on the last major part of the project, reporting. Almost all the requirements for reporting include the ability to download an excel file of the data. So previously I had been making heavy use of PEAR's Spreadsheet_Excel_Writer. In using it, I had gone through various stages of evolution
From time to time, someone does something with PHP that is truly unique -- something that goes far beyond the norm of PHP applications listed at Hotscripts and leaves you truly impressed by the capabilities of this language.
One prime example is Jedox's Worksheet Server, a truly unique combination of Microsoft Excel and PHP that enables users to build "online spreadsheets".
So you thought Excel was a proprietary software product beyond the developmental reach of the average open source programmer? Think again! Harry explains the use of PEAR::Spreadsheet_Excel_Writer to produce real live Excel spreadsheets in this hands-on tute.