> Thanks for your time. This is my code.
>
> <CFSETTING enablecfoutputonly="Yes">
> <html><body bgcolor="White">
> <cfquery name="qryGetSummary" datasource="csesdr" dbtype="ODBC">
> #Form.txtSql#
> #preserveSingleQuotes(Form.txtDate)#
> ORDER BY Niin
> </cfquery>
> <cfcontent type="application/unknown">
> <cfheader name="content-disposition" value="filename=Summary.xls">
> <cfloop query="qryGetSummary">
> <cfset strComment=#ReReplace("#cOMMENT#","[[:cntrl:]]"," ","ALL")#>
> <cfset strGood=#ReReplace("#niin#","[[:cntrl:]]"," ","ALL")#>
> <cfoutput>
> #strGood# #Activity#
> #DateFormat('#MaxOfmyDate#','mm/dd/yyy')# #strComment#
> #EquipmentValue# #DeficitQuantity#</cfoutput>
> </cfloop></body></html>
> <CFSETTING enablecfoutputonly="no">
>
>
> If I put the end <cfsetting> tag any earlier, then I get five lines in
> between every row in Excel.
Try this:
<cfsetting enablecfoutputonly="yes">
<cfquery ...>
...
</cfquery>
<cfheader ...>
<cfcontent ...>
<cfoutput query="qryGetSummary">"#REReplace(niin, "[[:cntrl:]]", " ",
"ALL")#","#Activity#","#DateFormat(MaxOfMyDate,
"mm/dd/yyyy")#","#REReplace(Comment, "[[:cntrl:]]", " ",
"ALL")#","#EquipmentValue#",#DeficitQuantity#
</cfoutput><cfsetting enablecfoutputonly="no">
This will output the data in CSV format, so you might want to name the file
as a CSV file. Since this'll wrap in your mail client, put all the variables
on the first line, and put the closing CFOUTPUT tag on the following line.
Don't put any HTML tags in the page, and put the CFHEADER before the
CFCONTENT tag. If you're using CF 4.5.x, you could use CFSILENT instead of
CFSETTING; it might work a bit better. In any case, it shouldn't matter if
there are a couple of blank lines before your data; Excel shouldn't have any
trouble opening the file.
Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.