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?
J
On Sat, 15 Jan 2005 00:48:31 -0000, Adrian Lynch
<[EMAIL PROTECTED]> wrote:
> I've just had a thought! Hey, come back... :OP
>
> If I include a cfcontent tag at the bottom of my App.cfm file, will
that
> take care of all the extra white space without the need for
> cfsilent/cfsetting with enablecfoutputonly set to yes AND not mess
with
> anything like the response headers?!
>
> Ron, if you can't get the headers sorted, have a look at generating
html
> instead, Excel will turn simple html into what you're after. You can
use
> this technique to format the excel file with background colours and
make
> font bold etc.
>
> Whatever happens, let us know how you get on.
>
> Ade
>
> -----Original Message-----
> From: Jared Rypka-Hauer - CMG, LLC [mailto:[EMAIL PROTECTED]
> Sent: 15 January 2005 00:29
> To: CF-Talk
> Subject: Re: Creating .xls files with column headers
>
> Sometimes I wonder if it wouldn't help to learn to read English...
>
> Yeppers, a quick perusal of the LiveDocs for 6.1 reveals my
> misunderstanding. I thought it discarded the content AFTER the request
> was processed...
>
> But, you're right, it discards all content from before the cfcontent
> tag was issued. However, it's default is YES, and the attribute is
> provided to protect against discarding chunks of pages that have
> content generated before and after the call to cfcontent (i.e. using
> CFCONTENT to provide inline animations).
>
> Since it's not being specified, it's default is already yes.
>
> Laterz,
> J
>
> --
> Continuum Media Group LLC
> Burnsville, MN 55337
> http://www.web-relevant.com
> http://cfobjective.blogspot.com
>
> On Sat, 15 Jan 2005 00:19:25 -0000, Adrian Lynch
> <[EMAIL PROTECTED]> wrote:
> > Good point.
> >
> > As for the reset attribute, I thought it determined whether all
output
> > before the tag was discared or not. Using it will take care of any
> unwanted
> > white space.
>
> --
> 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
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Find out how CFTicket can increase your company's customer support
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:190585
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=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54