Re: ColdFusion and Microsoft Excel
There is also the POI lib from Apache for all things Office. Very good at actually builing and Excel sheet. This e-mail is from Reed Exhibitions (Gateway House, 28 The Quadrant, Richmond, Surrey, TW9 1DN, United Kingdom), a division of Reed Business, Registered in England, Number 678540. It contains information which is confidential and may also be privileged. It is for the exclusive use of the intended recipient(s). If you are not the intended recipient(s) please note that any form of distribution, copying or use of this communication or the information in it is strictly prohibited and may be unlawful. If you have received this communication in error please return it to the sender or call our switchboard on +44 (0) 20 89107910. The opinions expressed within this communication are not necessarily those expressed by Reed Exhibitions. Visit our website at http://www.reedexpo.com -Original Message- From: Arden Weiss To: CF-Talk Sent: Tue Nov 28 02:13:05 2006 Subject: Re: ColdFusion and Microsoft Excel I tried with success in using the CFCONTENT method to generate Excel 2000 files; however, it blew up when Excel 2003 was on the client's machine. Instead, I bought the CFX_EXCEL product from MasRizal and it has worked flawlessly for just about a year now. See product at following link http://www.masrizal.com/index.cfm?fuseaction=idea.download_detailProductID= cfx_excel Question: I am a newb to CF and I have been assigned the daunting task of dynamically generating an excel file with absolutely no user action entailed. We currently have code that takes HTML and throws it in an excel file, but the user is prompted to download/save it. We dont want that. I have seen many different solutions given here, but i am not sure which to follow. The overall task is to create and excel file on the fly and then email it out to a user. Any help is appreciated. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:261823 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: ColdFusion and Microsoft Excel
Building :-) This e-mail is from Reed Exhibitions (Gateway House, 28 The Quadrant, Richmond, Surrey, TW9 1DN, United Kingdom), a division of Reed Business, Registered in England, Number 678540. It contains information which is confidential and may also be privileged. It is for the exclusive use of the intended recipient(s). If you are not the intended recipient(s) please note that any form of distribution, copying or use of this communication or the information in it is strictly prohibited and may be unlawful. If you have received this communication in error please return it to the sender or call our switchboard on +44 (0) 20 89107910. The opinions expressed within this communication are not necessarily those expressed by Reed Exhibitions. Visit our website at http://www.reedexpo.com -Original Message- From: Robertson-Ravo, Neil (RX) To: CF-Talk Sent: Tue Nov 28 08:06:46 2006 Subject: Re: ColdFusion and Microsoft Excel There is also the POI lib from Apache for all things Office. Very good at actually builing and Excel sheet. This e-mail is from Reed Exhibitions (Gateway House, 28 The Quadrant, Richmond, Surrey, TW9 1DN, United Kingdom), a division of Reed Business, Registered in England, Number 678540. It contains information which is confidential and may also be privileged. It is for the exclusive use of the intended recipient(s). If you are not the intended recipient(s) please note that any form of distribution, copying or use of this communication or the information in it is strictly prohibited and may be unlawful. If you have received this communication in error please return it to the sender or call our switchboard on +44 (0) 20 89107910. The opinions expressed within this communication are not necessarily those expressed by Reed Exhibitions. Visit our website at http://www.reedexpo.com -Original Message- From: Arden Weiss To: CF-Talk Sent: Tue Nov 28 02:13:05 2006 Subject: Re: ColdFusion and Microsoft Excel I tried with success in using the CFCONTENT method to generate Excel 2000 files; however, it blew up when Excel 2003 was on the client's machine. Instead, I bought the CFX_EXCEL product from MasRizal and it has worked flawlessly for just about a year now. See product at following link http://www.masrizal.com/index.cfm?fuseaction=idea.download_detailProductID= cfx_excel Question: I am a newb to CF and I have been assigned the daunting task of dynamically generating an excel file with absolutely no user action entailed. We currently have code that takes HTML and throws it in an excel file, but the user is prompted to download/save it. We dont want that. I have seen many different solutions given here, but i am not sure which to follow. The overall task is to create and excel file on the fly and then email it out to a user. Any help is appreciated. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:261824 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: ColdFusion and Microsoft Excel
The MasRizal product uses the Jakarta stuff... ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:261842 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: ColdFusion and Microsoft Excel
Yep that helps! Both of these sound great, but i am not exactly sure on how to go about coding this. Subject: RE: ColdFusion and Microsoft Excel From: Ben Nadel Date: Mon, 27 Nov 2006 15:45:37 -0500 Thread: http://www.houseoffusion.com/groups/CF-Talk/thread.cfm/threadid:49062#261780 The simple solution (but not the *best*): Create the Excel table using very simple HTML in a ColdFusion string buffer (CFSaveContent). Then save that file to a temporary file (CFFile to a file in a temp directory, possibly GetTempDirectory()). Use CFMailParam tag inside of CFMail to attach the File (FILE attribute). Make sure SPOOLING is NOT enabled. Send the email. Delete the temporary file. You have to make sure not to spool as you might delete the file before the email is sent. If you cannot control this, you can safe the file to a temp directory then just clear that directly periodically (say, every night or so). Does that help? . Ben Nadel Certified Advanced ColdFusion MX7 Developer www.bennadel.com Need ColdFusion Help? www.bennadel.com/ask-ben/ Question: I am a newb to CF and I have been assigned the daunting task of dynamically generating an excel file with absolutely no user action entailed. We currently have code that takes HTML and throws it in an excel file, but the user is prompted to download/save it. We dont want that. I have seen many different solutions given here, but i am not sure which to follow. The overall task is to create and excel file on the fly and then email it out to a user. Any help is appreciated. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:261854 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: ColdFusion and Microsoft Excel
Yes indeed. Our CFX_Excel uses Jakarta POI to deal with stuff. But it's significantly faster than other POI implementation according to our customers. We also plan to release CFX_Excel v3 before end of this year. IMHO POI only provides basic way to write/read Excel files. But when it comes to complex functions, we will have to code some more. In case someone needs any support while using CFX_Excel, please don't hesitate to contact me directly. Rizal - Probably the only Jakarta POI developer that actually lives in Jakarta - At 07:15 PM 28/11/2006, you wrote: The MasRizal product uses the Jakarta stuff... ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:261874 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: ColdFusion and Microsoft Excel
I have not tested this chunk, but this is the gist of what I was saying. cfsavecontent variable=strExcelData table tr tdHEADER/td /tr tr tdROW DATA/td /tr /table /cfsavecontent !--- Create a temp file. --- cfset strTempFile = GetTempFile( GetTempDirectory(), excel_data ) / !--- Get xls file name. --- cfset strXlsFile = REReplace( strTempFile, \.[a-z]+$, .xls, ONE ) / !--- Rename the file to be xls. --- cffile action=RENAME source=#strTempFile# destination=#strXlsFile# / !--- Write data to file. --- cffile action=WRITE file=#strXlsFile# output=#strExcelData# / !--- Send email NO SPOOLING. --- cfmail to= from= subject= spoolenable=no Blam blam blam cfmailparam file=#strXlsFile# / /cfmail !--- Delete temp file. --- cffile action=DELETE file=#strXlsFile# / .. Ben Nadel Certified Advanced ColdFusion Developer Nylon Technology 350 7th Avenue Floor 10 New York, NY 10001 212.691.1134 x 14 212.691.3477 fax www.nylontechnology.com Never chase the paranoid schizophrenics. -Original Message- From: Gabrielle Mack [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 28, 2006 9:58 AM To: CF-Talk Subject: Re: ColdFusion and Microsoft Excel Yep that helps! Both of these sound great, but i am not exactly sure on how to go about coding this. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:261881 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: ColdFusion and Microsoft Excel
Ok I understand everything except this chunk of bad boy: !--- Get xls file name. --- cfset strXlsFile = REReplace( strTempFile, \.[a-z]+$, .xls, ONE ) / That's simply replacing the file extension of the temporary file with .xls. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ Fig Leaf Software provides the highest caliber vendor-authorized instruction at our training centers in Washington DC, Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at your location. Visit http://training.figleaf.com/ for more information! ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:261893 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: ColdFusion and Microsoft Excel
it is replacing the extension of the filename with .xls On 11/28/06, Gabrielle Mack [EMAIL PROTECTED] wrote: Ok I understand everything except this chunk of bad boy: !--- Get xls file name. --- cfset strXlsFile = REReplace( strTempFile, \.[a-z]+$, .xls, ONE ) / Thank you so much for your help by the way. Are you single ;-P ? ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:261894 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: ColdFusion and Microsoft Excel
Thank you so much for your help by the way. Are you single ;-P ? Single, no. Willing to help out any time, of course :D .. Ben Nadel Certified Advanced ColdFusion MX7 Developer www.bennadel.com Need ColdFusion Help? www.bennadel.com/ask-ben/ -Original Message- From: Gabrielle Mack [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 28, 2006 12:59 PM To: CF-Talk Subject: ColdFusion and Microsoft Excel Ok I understand everything except this chunk of bad boy: !--- Get xls file name. --- cfset strXlsFile = REReplace( strTempFile, \.[a-z]+$, .xls, ONE ) / Thank you so much for your help by the way. Are you single ;-P ? ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:261897 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: ColdFusion and Microsoft Excel
Gabrielle, It really depends no the situation. THIS solution works for me a LOT. I do find, however, that it breaks on really really large files. I think Excel has trouble parsing the HTML into whatever internal format it uses. The benefits though is that it is easy to add things like CSS (borders, font-sizes, font-colors, etc). If you don't need any formatting or design type stuff, sometimes a CSV (plain text file) is best (and most light weight). The downside though is that the end user might have to import the data manually (not sure though). You have less control, regardless. You cannot tell the columns how to load (treat as text vs. treat as numbers - something you can mess with using HTML version). The *best* solution might be to use some sort of Excel COM object (as other people mentioned), but that has some serious overhead to it, not to mention the buying of third party projects OR the installing of some Java packages. It however, creates REAL Excel documents. I would use this only when you need maximum control (or if you need to import FROM an excel file). For small to moderate things, though, the HTML version has worked great for me. .. Ben Nadel Certified Advanced ColdFusion MX7 Developer www.bennadel.com Need ColdFusion Help? www.bennadel.com/ask-ben/ -Original Message- From: Gabrielle Mack [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 28, 2006 3:36 PM To: CF-Talk Subject: ColdFusion and Microsoft Excel This is a great solution. But what, dare i ask, would you consider to be the *best*? ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:261916 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: ColdFusion and Microsoft Excel
Another thing to try if you have a complex spreadsheet (i.e. formulas, multiple sheets, etc.) is to create the spreadsheet in Excel with all of the formatting and such you need, then do save as single file web page (.mht) from Excel. Open the file up in a Dreamweaver or whatever and dig through the markup to find the cells you need to be dynamic, and replace them with the appropriate CF code. Once you spend a little time getting a feel for the Excel-specific markup then generating rows, columns, etc. isn't too hard. Now, rename the file to end in .cfm, and cfinclude the template within the cfsavecontent from the previous solution, and the rest should work out the same. Excel opens it right up with formatting, multiple sheets, formulas etc. intact. I don't know if it would retain, say, charts or pivot tables or more complex stuff like that (haven't tried it). This works well for Word also by the way, retaining margins, page breaks, etc. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:261919 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: ColdFusion and Microsoft Excel
Doug. That is a good solution idea to explore. As far as charts, I think the MHT file actually stores a Base64 GIF image of the chart. Then when you open it up in Excel, it has the GIF chart, but does not recompute based on the excel data. But, I have not tried anything that complex in a while. If nothing else, this method helps you figure out how to get numeric columns to render AS text (so that leading zeros don't get taken off and date/time values don't go all weird). .. Ben Nadel Certified Advanced ColdFusion MX7 Developer www.bennadel.com Need ColdFusion Help? www.bennadel.com/ask-ben/ -Original Message- From: Doug Bezona [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 28, 2006 3:59 PM To: CF-Talk Subject: RE: ColdFusion and Microsoft Excel Another thing to try if you have a complex spreadsheet (i.e. formulas, multiple sheets, etc.) is to create the spreadsheet in Excel with all of the formatting and such you need, then do save as single file web page (.mht) from Excel. Open the file up in a Dreamweaver or whatever and dig through the markup to find the cells you need to be dynamic, and replace them with the appropriate CF code. Once you spend a little time getting a feel for the Excel-specific markup then generating rows, columns, etc. isn't too hard. Now, rename the file to end in .cfm, and cfinclude the template within the cfsavecontent from the previous solution, and the rest should work out the same. Excel opens it right up with formatting, multiple sheets, formulas etc. intact. I don't know if it would retain, say, charts or pivot tables or more complex stuff like that (haven't tried it). This works well for Word also by the way, retaining margins, page breaks, etc. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:261922 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: ColdFusion and Microsoft Excel
Well, changing the values in the .MHT won't change the gif version of the chart that's embedded, BUT the chart does get updated against the proper values when re-imported to Excel (just tested it). -Original Message- From: Ben Nadel [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 28, 2006 4:09 PM To: CF-Talk Subject: RE: ColdFusion and Microsoft Excel Doug. That is a good solution idea to explore. As far as charts, I think the MHT file actually stores a Base64 GIF image of the chart. Then when you open it up in Excel, it has the GIF chart, but does not recompute based on the excel data. But, I have not tried anything that complex in a while. If nothing else, this method helps you figure out how to get numeric columns to render AS text (so that leading zeros don't get taken off and date/time values don't go all weird). ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:261924 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: ColdFusion and Microsoft Excel
Rey. That is GOOD to know. Thanks! Yeah, I only tested it once or twice, and ended up abandoning that approach (for a number of reasons unrelated) so I didn't get to fully test. But that is very good to know. Thanks! .. Ben Nadel Certified Advanced ColdFusion MX7 Developer www.bennadel.com Need ColdFusion Help? www.bennadel.com/ask-ben/ -Original Message- From: Doug Bezona [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 28, 2006 4:27 PM To: CF-Talk Subject: RE: ColdFusion and Microsoft Excel Well, changing the values in the .MHT won't change the gif version of the chart that's embedded, BUT the chart does get updated against the proper values when re-imported to Excel (just tested it). -Original Message- From: Ben Nadel [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 28, 2006 4:09 PM To: CF-Talk Subject: RE: ColdFusion and Microsoft Excel Doug. That is a good solution idea to explore. As far as charts, I think the MHT file actually stores a Base64 GIF image of the chart. Then when you open it up in Excel, it has the GIF chart, but does not recompute based on the excel data. But, I have not tried anything that complex in a while. If nothing else, this method helps you figure out how to get numeric columns to render AS text (so that leading zeros don't get taken off and date/time values don't go all weird). ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:261927 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: ColdFusion and Microsoft Excel
It may, of course, depend on the version of Excel (I tested on ver. 2003 on Windows) -Original Message- From: Ben Nadel [EMAIL PROTECTED] To: CF-Talk cf-talk@houseoffusion.com Sent: 11/28/06 4:36 PM Subject: RE: ColdFusion and Microsoft Excel Rey. That is GOOD to know. Thanks! Yeah, I only tested it once or twice, and ended up abandoning that approach (for a number of reasons unrelated) so I didn't get to fully test. But that is very good to know. Thanks! ... Ben Nadel Certified Advanced ColdFusion MX7 Developer www.bennadel.com Need ColdFusion Help? www.bennadel.com/ask-ben/ -Original Message- From: Doug Bezona [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 28, 2006 4:27 PM To: CF-Talk Subject: RE: ColdFusion and Microsoft Excel Well, changing the values in the .MHT won't change the gif version of the chart that's embedded, BUT the chart does get updated against the proper values when re-imported to Excel (just tested it). -Original Message- From: Ben Nadel [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 28, 2006 4:09 PM To: CF-Talk Subject: RE: ColdFusion and Microsoft Excel Doug. That is a good solution idea to explore. As far as charts, I think the MHT file actually stores a Base64 GIF image of the chart. Then when you open it up in Excel, it has the GIF chart, but does not recompute based on the excel data. But, I have not tried anything that complex in a while. If nothing else, this method helps you figure out how to get numeric columns to render AS text (so that leading zeros don't get taken off and date/time values don't go all weird). ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:261939 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: ColdFusion and Microsoft Excel
I think that's what I tested on also... I am curious though, I will do some more testing over on this end. Thanks. .. Ben Nadel Certified Advanced ColdFusion MX7 Developer www.bennadel.com Need ColdFusion Help? www.bennadel.com/ask-ben/ -Original Message- From: Doug Bezona [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 28, 2006 5:48 PM To: CF-Talk Subject: RE: ColdFusion and Microsoft Excel It may, of course, depend on the version of Excel (I tested on ver. 2003 on Windows) ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:261942 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: ColdFusion and Microsoft Excel
The simple solution (but not the *best*): Create the Excel table using very simple HTML in a ColdFusion string buffer (CFSaveContent). Then save that file to a temporary file (CFFile to a file in a temp directory, possibly GetTempDirectory()). Use CFMailParam tag inside of CFMail to attach the File (FILE attribute). Make sure SPOOLING is NOT enabled. Send the email. Delete the temporary file. You have to make sure not to spool as you might delete the file before the email is sent. If you cannot control this, you can safe the file to a temp directory then just clear that directly periodically (say, every night or so). Does that help? .. Ben Nadel Certified Advanced ColdFusion MX7 Developer www.bennadel.com Need ColdFusion Help? www.bennadel.com/ask-ben/ -Original Message- From: Gabrielle Mack [mailto:[EMAIL PROTECTED] Sent: Monday, November 27, 2006 3:40 PM To: CF-Talk Subject: ColdFusion and Microsoft Excel Question: I am a newb to CF and I have been assigned the daunting task of dynamically generating an excel file with absolutely no user action entailed. We currently have code that takes HTML and throws it in an excel file, but the user is prompted to download/save it. We dont want that. I have seen many different solutions given here, but i am not sure which to follow. The overall task is to create and excel file on the fly and then email it out to a user. Any help is appreciated. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:261780 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: ColdFusion and Microsoft Excel
How complex of an Excel file? Can the data be represented by a simple comma or tab delimitated CSV file? If so to would be pretty easy to build such a file in ColdFusion and mail it anywhere you like. For most people .csv is a native format to Excel, it would automatically open with that software. If you need a full blown .xls binary file, that is much more of a challenge. I've heard there is a custom tag that may help, but I've never used it. I've done COM object stuff with Excel and Word before, but that is difficult, requires the office software to run on the server and is vary fragile. This is a solution to be avoided if at all possible. -- Ian Skinner Web Programmer BloodSource www.BloodSource.org Sacramento, CA - | 1 | | - Binary Soduko | | | - C code. C code run. Run code run. Please! - Cynthia Dunning Confidentiality Notice: This message including any attachments is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender and delete any copies of this message. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:261781 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: ColdFusion and Microsoft Excel
I agree with Ian. Use CSV if you can. I think there's a function or two on cflib.org to create CSV files. If you have to create an .xls this may be easier than COM. http://jakarta.apache.org/poi/ Patrick -- Patrick McElhaney 704.560.9117 ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:261805 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: ColdFusion and Microsoft Excel
I tried with success in using the CFCONTENT method to generate Excel 2000 files; however, it blew up when Excel 2003 was on the client's machine. Instead, I bought the CFX_EXCEL product from MasRizal and it has worked flawlessly for just about a year now. See product at following link http://www.masrizal.com/index.cfm?fuseaction=idea.download_detailProductID=cfx_excel Question: I am a newb to CF and I have been assigned the daunting task of dynamically generating an excel file with absolutely no user action entailed. We currently have code that takes HTML and throws it in an excel file, but the user is prompted to download/save it. We dont want that. I have seen many different solutions given here, but i am not sure which to follow. The overall task is to create and excel file on the fly and then email it out to a user. Any help is appreciated. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:261808 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: ColdFusion and Microsoft Excel
SpreadsheetML might be the best way to do this. The quick and easy way to create a SpreadsheetML file is to create a mockup of your spreadsheet in Excel, then save it as XML. This creates an XML file with all the formatting you need. All you need to do is recreate that file with dynamic data, and you've got an instant Excel spreadsheet. More info here: http://www.javaworld.com/javaworld/jw-07-2004/jw-0712-officeml.html Bye! -Original Message- From: Gabrielle Mack [mailto:[EMAIL PROTECTED] Sent: Tuesday, 28 November 2006 7:40 AM To: CF-Talk Subject: ColdFusion and Microsoft Excel Question: I am a newb to CF and I have been assigned the daunting task of dynamically generating an excel file with absolutely no user action entailed. We currently have code that takes HTML and throws it in an excel file, but the user is prompted to download/save it. We dont want that. I have seen many different solutions given here, but i am not sure which to follow. The overall task is to create and excel file on the fly and then email it out to a user. Any help is appreciated. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:261813 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4