All,
I am using the following code (taken from http://www.tom-muck.com/ ) to
generate csv file.
<cfparam name="attributes.rs">
<cfset c=attributes.rs.ColumnList/>
<cfset cc = listqualify(#c#,'"',",","all")>
<CFHEADER
NAME="Content-Disposition"VALUE="attachment;filename=#attributes.filename#">
<CFCONTENT TYPE="application/unknown">
<cfoutput>#cc##chr(13)##chr(10)#</cfoutput>
<cfoutput query="attributes.rs">
<cfloop list="#c#"
index="f">#q##attributes.rs[f][attributes.rs.currentrow]##q#
<cfif f NEQ listlast(c)>,</cfif>
</cfloop>#chr(13)##chr(10)#
</cfoutput>
It works fine if the record count is greater than one.
But if the records returned is one, then the data is dumped in to one cell only.
Thank you,
Raj
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
ColdFusion MX7 and Flex 2
Build sales & marketing dashboard RIAâs for your business. Upgrade now
http://www.adobe.com/products/coldfusion/flex2?sdid=RVJT
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:275174
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4