Question
export to excel
Hi All,
I'm exporting a query to excel file but my code is on the top of the page
after the query. I'm using get method to validate the form with url
variables.
The download works, but at the end of the file also includes all page code.
I try cfabort but doesn't work.
FYI I'm using cf7 with application.cfc
How can I fix this problem?
Thank you in advance.
Johnny
<cfif IsDefined("url.downloadReport")>
<CFHEADER NAME="Content-Disposition" VALUE="inline;
filename=contactsReport.csv">
<CFCONTENT
TYPE="application/unknown">"Company","City","State","Zipcode","SalesRep","Type","First
Name","Last Name","Title","Phone","Ext","Mobile","Fax","Email"
<cfoutput
query="getStruc">"#customer#","#city#","#state#","#Zipcode#","#appearance#","#typeDesc#","#cfirstName#","#clastName#","#ctitle#","#cPhone#","#cExtension#","#cMobile#","#cFax#","#cEmail#"#chr(13)#</cfoutput>
<cfabort>
</cfif>
I'm exporting a query to excel file but my code is on the top of the page
after the query. I'm using get method to validate the form with url
variables.
The download works, but at the end of the file also includes all page code.
I try cfabort but doesn't work.
FYI I'm using cf7 with application.cfc
How can I fix this problem?
Thank you in advance.
Johnny
<cfif IsDefined("url.downloadReport")>
<CFHEADER NAME="Content-Disposition" VALUE="inline;
filename=contactsReport.csv">
<CFCONTENT
TYPE="application/unknown">"Company","City","State","Zipcode","SalesRep","Type","First
Name","Last Name","Title","Phone","Ext","Mobile","Fax","Email"
<cfoutput
query="getStruc">"#customer#","#city#","#state#","#Zipcode#","#appearance#","#typeDesc#","#cfirstName#","#clastName#","#ctitle#","#cPhone#","#cExtension#","#cMobile#","#cFax#","#cEmail#"#chr(13)#</cfoutput>
<cfabort>
</cfif>