What version of fusebox is it?
You should be able to swap or suppress the layout around the csv content.
-Original Message-
From: Glyn Jackson [mailto:glyn.jack...@newebia.co.uk]
Sent: Friday, December 04, 2009 9:12 AM
To: cf-talk
Subject: fusebox layout adding to csv?
Hi I have an old fusebox app i am working on. it outputs a csv file with
data however the html (layout) is also getting added to the csv? anyone know
why.
cfsetting enablecfoutputonly=yes
cfscript
function cleanField(sField){
sField = (replace(sField,,,;,All));
sField = (replace(sField,chr(13)chr(10),;,All));
sField = (replace(sField,chr(13),;,All));
sField = (replace(sField,chr(10),;,All));
sField = (replace(sField,;;,;,All));
return sField;
}
/cfscript
cfsilent
cfset variables.columns = ArrayToList(
Evaluate(#variables.thisQueryName#.getColumnNames()) )
cfset csv_TextBuffer =
createObject(java,java.lang.StringBuffer).init()
cfset csv_TextBuffer.append(variables.columns CHR(13))
cfloop query=#variables.thisQueryName#
cfset variables.record = /
cfloop list=#variables.columns# delimiters=, index=colName
cfset variables.colVal =
cleanField(Evaluate(#variables.thisQueryName#[variables.colName]))
#variables.colName#=#variables.colVal#,
cfset variables.record = variables.record
#variables.colVal#,
/cfloop
cfset csv_TextBuffer.append( variables.record CHR(13)) /
/cfloop
cfdump var=#variables.thisQueryName#
cfheader name=Content-Disposition value=attachment;
filename=#request.filePreFix#-FF2009-#fusebox.fuseaction#.csv
cfcontent reset=true type=text/csv
/cfsilent
cfoutput#csv_TextBuffer.toString()#/cfoutput
~|
Want to reach the ColdFusion community with something they want? Let them know
on the House of Fusion mailing lists
Archive:
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328835
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4