Just write a plain HTML table, and then use CFCONTENT to trick the browser into thinking it's an excel file. Excel will automatically do the HTML -> XML conversion when it is opened for the first time. Hell of a lot easier the dealing with plaintext formatting.
barneyb > -----Original Message----- > From: "Chakka [mailto:"Chakka] > Sent: Friday, February 14, 2003 10:11 AM > To: CF-Talk > Subject: Exporting to Excel from SQlServer using ColdFusion > > > Hi, > > Can anybody send me the code snippet using I can export the data to > Excel spread sheet. I am able to create a '.csv' file but not a > '.xls' file. > > When I am using the '.xls' for creating the file it is dumping all > the information, using a coma delimited list into one column and not > separating them into separate columns. > > Can anybody give me code snippet or direction in which I have to > work > for this. > > The code I am using is: > > <cffile action="WRITE" addnewline="Yes" file="USE_THIS_FOR_AWARDS.csv" > output="AWARDID, LASTNAME, FIRSTNAME, MIDDLENAME, COURSENAME, SEMESTER, > SCHOOLNAME"> > > <cfoutput query="awardsList"> > <cffile action="APPEND" addnewline="Yes" file="USE_THIS_FOR_AWARDS.csv" > output="#AWARDID#, #LASTNAME#, #FIRSTNAME#, #MIDDLENAME#, > #COURSENAME#, #SEMESTER#, #ORGANIZATIONNAME#"> > </cfoutput> > > > Any help is appreaciated!! > - Sudheer > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting. Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

