GOT IT TO WORK!
I added an additional <cfcontent> and <cfoutput> with the column header
information separated by the #TAB#. Then in the second <cfcontent>
which contains the output from the query, I changed the reset value to
"No" so the header information from the 1st <cfcontent> wouldn't be
purged when the 2nd <cfcontent> ran.
This is awesome because I needed the process to be as easy and
streamlined so the client could create their own .xls files on the fly.
Thanks everyone for all the tips!
<CFSETTING ENABLECFOUTPUTONLY="yes">
<CFSET TAB=CHR(9)>
<CFQUERY NAME="get_Data" DATASOURCE="MYSOURCE">
SELECT Registration_Type, Name_First, Name_Last, Title,
Group_Company, Address, City, Phone, Fax, Spouse
FROM data
</CFQUERY>
<CFHEADER NAME="Content-Disposition" VALUE="inline;
filename=contact-#saveDate#-#saveTime#.xls">
<CFCONTENT RESET="Yes" TYPE="application/msexcel"><cfoutput>Registration
Type#TAB#First Name#TAB#Last
Name#TAB#Title#TAB#Company/Group#TAB#Address#TAB#City#TAB#Phone#TAB#Fax#
TAB#Spouse#TAB#
</cfoutput>
<CFCONTENT RESET="No" TYPE="application/msexcel"><CFOUTPUT
QUERY="get_Data">#Registration_Type##TAB##Name_First##TAB##Name_Last##TA
B##Title##TAB##Group_Company##TAB##Address##TAB##City##TAB##Phone##TAB##
Fax##TAB##Spouse##TAB#
</CFOUTPUT>
-----Original Message-----
From: Jared Rypka-Hauer - CMG, LLC [mailto:[EMAIL PROTECTED]
Sent: Friday, January 14, 2005 7:09 PM
To: CF-Talk
Subject: Re: Creating .xls files with column headers
You should be able to use this
head1, head2, head3
<cfoutput>#data1#,#data2#,#data3#
<cfoutput>
should pick up in excel without issue...
does it?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Purchase Contribute 3 from House of Fusion, a Macromedia Authorized Affiliate
and support the CF community.
http://www.houseoffusion.com/banners/view.cfm?bannerid=53
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:190586
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54