Exporting a Query to a TAB
May 18th, 2006
For some reports, I’ve needed to export a query into a Tab Delimited file to be opened by Excel on the users machine. I developed the following to do this, you’re free to use it for anything you like. I wrote it back in my CF5 days and never looked back, so comments on improving are welcome.
You can then use this to dump the file to the users browser like so:
1 | <CFCONTENT TYPE="application/msexcel"><cfheader name="Content-Disposition" value="filename=user_report.xls"><CFOUTPUT>#QueryExport(qryMyQueryData)#<cfabort></cfoutput> |
