Monday, December 01, 2008

Export to CSV with Coldfusion

I am trying to finally get a good export to CSV working, using coldfusion. There are alot of posts, many of them by Ben Nadel.

Ended up using the example from: Converting A ColdFusion Query To CSV Using QueryToCSV()

This worked great except there were lots of blank rows at the top of the file and at the bottom. The fix was found here: Extra white-space after page proccess

<cfcontent reset="yes"><cfoutput>#Trim (yourvar)#</cfoutput><cfabort>

It was important to put it on one line to, otherwise there was an extra line for each line return.