Get rid of all the extra space after the cfcontent tag.

Try:

<cfcontent type="application/msexcel"><cfoutput query="get
Data">#Name_First##TAB##Name_Last##TAB##Group_Company#</cfoutput>

Also, would setting the reset attribute of cfcontent help any?

Ade

-----Original Message-----
From: Ron Eis [mailto:[EMAIL PROTECTED]
Sent: 14 January 2005 22:52
To: CF-Talk
Subject: Creating .xls files with column headers


I'm trying to add the headers in an .xls file created from my query.  I
get all the data from the query but how do I add the column headers in
the Excel spreadsheet?

Also, my data is output on every other line of the spreadsheet.  Only
the "even" numbers of the spreadsheet have data.

Can anyone help?


<cfset todayDate = #Now()#>
<cfset saveDate = #DateFormat(todayDate,('yymmdd'))#>
<cfset saveTime = #TimeFormat(todayDate,('HHmm'))#>

<CFSETTING ENABLECFOUTPUTONLY="yes">

<CFSET TAB=CHR(9)>

<CFQUERY NAME="get_Data" DATASOURCE="mydatasource">
        SELECT Name_Last, Name_First, Group_Company,
        FROM  data
        ORDER by Name_Last, Name_First
</CFQUERY>

<CFHEADER NAME="Content-Disposition" VALUE="inline;
filename=savedfile-#saveDate#-#saveTime#.xls">
<CFCONTENT TYPE="application/msexcel">

<CFOUTPUT QUERY="get Data">

#Name_First##TAB##Name_Last##TAB##Group_Company#

</CFOUTPUT>
--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.6.11 - Release Date: 12/01/2005


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble 
Ticket application

http://www.houseoffusion.com/banners/view.cfm?bannerid=48

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:190551
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

Reply via email to