Format as Table

Topics: User Forum
Dec 22, 2008 at 10:00 PM
Most reports I've made manually are turned into tables so they have the alternately colored rows and it makes it easier for the execs to sort/filter. Is it possible to do this? I'd assume it could be through the style array...but I can't find anything about it in the dev documentation or this forum. (speaking of which, it'd be great to get some suggestions on other sources of information on PHPExcel and related stuff)
Dec 22, 2008 at 11:38 PM
Maybe take a look at setAutoFilter(), setAutoFilterByColumnAndRow() methods for the worksheet object. They may do the trick? At least for Excel 2007. I haven't played so much with them so I don't have sample code.

As for documentation, you may be saying something. Perhaps there should also be an online version which can be updated quickly (wiki)? Not sure... Others may have an opinion about this.
Dec 23, 2008 at 5:55 AM
Could you maybe find a way to implement the table presets that Excel 2007 has in it? I'm not sure how hard that would be, but if it could be done that would be a handy feature to have.
Dec 23, 2008 at 5:48 PM
Yeah, that's exactly what I was looking into. I would assume that it'd be something with an array, ie:

array('table' => PHPExcel_Style_Table::TABLE_STYLE_MEDIUM_9),

(note that this is not correct in the least - just what I would think could be on the right track...)

koyama - the wiki idea is great. It would be awesome to have something similar to PHP's manual...where you can look functions up and get examples and user contributions. So far it's been me trying to find my way in the dark, haha. I'm getting's just taking awhile.