Today I was able to add a new tool to my bag of CF tricks: POI for Cold Fusion. Thanks to Kinky Solutions POI Utility generating MS Excel docs was extremely easy. I encountered one problem, when columns contained no data, but it was an easy fix. Here’s what I posted to the comment board on Kinky’s site:

I discovered that if you have a blank field the makequery.cfm function throws an exception because it ignores the blank field and then the column counts are off at the listGet() function.

This line “fixes” the problem by inserting a space in any blank field.

<cfset strSetup = strSetup.ReplaceAll(“\|\|”, “| |”)/>

I put it right after these:

<!— Clean up the generated content. —>
<cfset strSetup = strSetup.ReplaceAll(“(?m)^[\t ]+|[\t ]+$”,”") />

Tagged with: