For the last number of years, excel can actually read and display an HTML table properly with formatting and all. I use the cfcontent and cfheader, etc so the browser thinks its an excel spreadsheet and opens it in excel. This way allows you to put column heads, titles, row spanning, etc and excel seems to handle it just fine. If someone wants a copy they can save as a .xls and excel converts the format to native excel. Hope this helps.
-----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 31, 2007 4:44 PM To: CF-Newbie Subject: RE: Output to excel Nick G, The following works for me on one of my excel pages. This is an example on the page I am sending the information to. I assume you have set this up correctly on your preceding page. <cfset TabChar = Chr(9)> <cfset NewLine = Chr(13) & Chr(10)> <cfset SpaceChar = Chr(32)> <cfcontent type="application/msexcel"> <cfheader name="Content-Disposition" value="filename=Global_Reports.xls"> <cfloop from="1" to="#ArrayLen(Session.EXCEL.field1)#" index="ThisItem"> <cfoutput> #Session.EXCEL.field1[ThisItem]# #TabChar# #Session.EXCEL.field2[ThisItem]# #TabChar# #Session.EXCEL.field3[ThisItem]# #TabChar# #Session.EXCEL.field4[ThisItem]# #TabChar# #Session.EXCEL.field5[ThisItem]# #TabChar# #Session.EXCEL.field6[ThisItem]# #TabChar# #Session.EXCEL.field7[ThisItem]# #TabChar# #Session.EXCEL.field8[ThisItem]# #NewLine# </cfoutput> </cfloop> Zelda -----Original Message----- From: Nick G [mailto:[EMAIL PROTECTED] Sent: Monday, January 22, 2007 12:27 PM To: CF-Newbie Subject: Output to excel I am using several queries to create a table of information and I use this to send it to an excel file: <cfheader name="Content-Disposition" value="attachment;filename=Eligibles.xls;"> <cfcontent type="application/msexcel"> However, instead of sending it to excel as it appears on the screen (it looks like three table side by side), it stacks them on top of each other. Is there anyway to control the formatting besides adjusting the table code? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Upgrade to Adobe ColdFusion MX7 Experience Flex 2 & MX7 integration & create powerful cross-platform RIAs http:http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU Archive: http://www.houseoffusion.com/groups/CF-Newbie/message.cfm/messageid:2475 Subscription: http://www.houseoffusion.com/groups/CF-Newbie/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15
