Here's something that does the job properly:
For this to work properly, however, "column" must be a property on a Managed Bean and "columnName" must be a property such that its getColumnName accessor method returns String, if the column propety is an int, or must be a Map, if the column property is a String. I'm taking it as a given that you are initializing and incrementing "column" in a Facelets ui:repeat or something similar.
An IDE is no substitute for an Intelligent Developer.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com