Here is a good bit of code to display Coldfusion CFQuerys as an embedded Excel spreadsheet right in the user's browser.
<!--- Add these lines to top of the page --->
<cfcontent type="application/x-msexcel; charset=utf-16" reset="No">
<cfheader name="Content-Type" value="xls">
<cfheader name="Content-Disposition" value="attachment; filename=test.xls">
<cfheader name="Expires" value="0">
<!--- Next create your query --->
<cfquery username="username" password="password" datasource="DS" NAME="MyQuery">
<!--- Now just output a table...including column names--->
<cfset szColumns = MyQuery.columnList>
<table border="1" cellpadding="1" cellspacing="2"><tr>
<cfloop index="szColName" list=#szColumns#>
<cfoutput>
<th>#szColName#</th>
</cfoutput>
</cfloop>
</tr>
<CFLOOP QUERY="MyQuery">
<tr>
<CFLOOP INDEX="X" LIST="#MyQuery.ColumnList#" DELIMITERS=",">
<CFSET formatted = Replace(Evaluate(#X#), ",", "", "ALL")>
<cfoutput><td>#formatted#</td></cfoutput>
</CFLOOP>
</tr>
</CFLOOP>
</table>
And voila! The browser should now contain an embedded Excel document, with Excel toolbars and everything. The user can now save the document right to their computer as an Excel document! Of coarse this code only works if the user has Excel (or the Excel viewer) on their computer, so this sample is best for Web Applications where all the users do have Excel. But often, as in Web Apps you know that your client has Excel, and wants to see database data in an Excel document.
Anyway, I'd thought I'd share this code with you because all of the sample code I found while researching this is just plain wrong! And doesn't work. This code DOES work, so feel free to use it as you see fit.