Re: Displaying an Excel file in a CF page, period.
Is there a sample out there somewhere? I messed with it but couldn't get it to work. Is there a reason you cannot just read in the file as binary. Then display it inline with cfcontent and correct mime header (assuming the user's browser settings allow ...)? ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:344160 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Displaying an Excel file in a CF page, period.
I'll take a whack at it, thanks much! Something like: !--- make sure user is authenticated --- !--- read in the file as binary. --- cffile action=readbinary file=#expandpath('../../../path/to/excel/file/stored/outside/web/root/excel.xls')# variable=myvar !--- Then display it inline with cfcontent and correct mime header (assuming the user's browser settings allow ...)? --- cfcontent variable=#myvar# type=application/msexcel Note: if you need to do this in a page that has other stuff on it, you could use a frame or an iframe. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:344168 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Displaying an Excel file in a CF page, period.
Well it appears that MX 6.1 doesn't support the variable attribute of cfcontent. I may have access to CF9 tomorrow, but in the meantime is there any way to get this file delivered with MX 6.1? ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:344175 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Displaying an Excel file in a CF page, period.
Thanks! I've got it prompted to download the file with: cffile action=readbinary file=path-to-the-dir\deliveryschedule.xls variable=myvar cfheader name=Content-Disposition value=inline; filename=deliveryschedule.xls cfcontent type=application/vnd.ms-excel file=path-to-the-dir\deliveryschedule.xls ...but it's still a no-go on displaying inline. Presumably the downloader can still edit the file if they want to. Try: cfcontent file=#expandpath('../../../path/to/excel/file/stored/outside/web/root/excel.xls')# type=application/msexcel ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:344181 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Displaying an Excel file in a CF page, period.
Thank you both. In IE it opens in the browser window (prompts first), in Firefox it prompts for download. This may be as good as I can get without reading the file and writing tables..? Currently using cfheader name=Content-Disposition value=inline; filename=deliveryschedule.xls cfcontent type=application/vnd.ms-excel file=file-location\deliveryschedule.xls (if i add the cfoutput code it does the same thing) ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:344195 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Displaying an Excel file in a CF page, period.
Will this do something different than what i'm doing in 6.1 now? If so I'll try it tomorrow when I'll hopefully access to CF9. Put the file outside a web accessible directory and serve it up as binary using cfcontent variable=#binaryData# not cfcontent file=.. . ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:344196 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Displaying an Excel file in a CF page, period.
I've been tearing my hair out all day with this. I have an Excel file that will be uploaded each day by one user who logs in and uploads it via a form. The Excel file has multiple worksheets. The names of the worksheets and even the columns will change and I won't be privy to these changes. I have a few other users who need to log in and view the file. I do not want it to be edited, just viewed. I realize I can have User1 save the file as read-only and can just link to the the Excel file when authenticated users login but I want it to only be available via a CF page because we are using CF based authentication, and SSL. I am open to ideas...most solutions I've found have dealt with editing and writing Excel with CF. I just want to display the file, inline if possible, and only to those who have logged in successfully via my CF login system. Help?...and many thanks in advance. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:344141 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Displaying an Excel file in a CF page, period.
Thanks. I found that earlier today and actually tried it out but numerous errors frustrated me. I'm dealing with MX 6.1 and even though I found and applied a fix to the CFC for 6.1, I just got a different error down the line. I am really hoping to just be able to display the Excel file within the page, not extract objects from it or manipulate it in any way since i don't need to DO anything to the Excel file at all. As with soo many things on this forum... the answer is usually - Ben Nadel Ben wrote a wrapper for a java package that interfaces with Excel, called POI http://www.bennadel.com/projects/poi-utility.htm http://www.bennadel.com/projects/poi-utility.htmIt's pretty badass, point it at an Excel file and you'll get back an array of objects essentially containing all the sheets and all the data in the sheets (as queries) Once as query objects you can choose to display the data however you want, including in grid form (check the jquery site for good grids to use) =] ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:344145 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm