PHP to XLS .. adding styling

In my cms there is a module and it allows you to export all orders for a particular date to an xls file.
I have it all working, but I am unable to style the columns to dynamic widths or add any colours.

Take a look at the php code here: http://dev.andrewodendaal.com/exportXls.php.txt

I’d suggest using a better written xls module, as it looks like that one is just using procedural functions?

I can vouch for PHPExcel as being an excellent solution that offers a friendly and easy to use interface and pretty good documentation too.

http://phpexcel.codeplex.com/Wikipage

Over the weekend I was making good use of PEAR’s Spreadsheet_Excel_Writer

While I had good success, is there any consensus on the pros and cons between them?

I haven’t used the PEAR implementation. I guess you could say the pro for PHPExcel is that you don’t have to use PEAR!

PHPExcel handles pretty much anything, multiple sheets, references and functions, xlsx.

Again, not sure what Spreadsheet_Excel_Writer has!

My only reason for using the PEAR one is that the server already had PEAR installed and was using some other PEAR features.

It may be useful to gain some insight from someone who has used the two, or even an article about them, so that we may find out the significant differences between the them.

The documentation says that the Excel 5 (BIFF) file format is just a modification of PEAR’s Spreadsheet_Excel_Writer, so is PHPExcel just a native implementation of PEAR’s one? Enquiring minds want to know.