I am trying to output the results of a query to Excel, but instead, it 
opens CF Builder. Please advise. TNX.


<cfquery name="gettemp" datasource="#application.datasource#">
select location,score from SPDOut
where SPDINput_id=#url.id#
order by location
</cfquery>

<cfsetting enablecfoutputonly="yes"> <!--- Required for CSV export to 
function properly --->
<cfset delim = 44> <!--- Use a comma for a field delimitter, Excel will 
open CSV files --->

<cfcontent type="application/msexcel">
<cfheader name="Content-Disposition" value="#url.id#-export.csv">

<!--- Output Column Headers --->
<cfoutput>Location#chr(delim)#Score#chr(delim)#</cfoutput>

<cfoutput>#chr(13)#</cfoutput> <!--- line break after column header --->

<!--- Spill out data from a query --->
<cfloop 
query="gettemp"><cfoutput>#location##chr(delim)##score##chr(13)#</cfoutput></cfloop>


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:343876
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to