Solved

CfContent types for excel

Posted on 2002-03-28
16
649 Views
Last Modified: 2013-12-24
I am having difficulty with CFContent opening into Excel. On my computer it works fine, on others Excel will open but no data is populated and/or it can't resolve the form parameters I'm sending to it. Does this have to do with setting up mime types? Is there a standard configuration I can set so this will work across all computers.

Here's the line of code I am using:

<CFCONTENT type="application/vnd.ms-excel">

Thanks!
0
Comment
Question by:kari208
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 8
  • 8
16 Comments
 
LVL 19

Expert Comment

by:cheekycj
ID: 6903345
try one of these"
   application/vnd.ms-excel  
   application/x-msexcel  
   application/ms-excel
   application/msexcel
   application/x-excel
0
 
LVL 19

Expert Comment

by:cheekycj
ID: 6903347
actually.. now re-reading the question... the issue might be the mime types setup for the browser.. which browser is it?

CJ
0
 

Author Comment

by:kari208
ID: 6903350
IE 5.5
0
Transaction Monitoring Vs. Real User Monitoring

Synthetic Transaction Monitoring Vs. Real User Monitoring: When To Use Each Approach? In this article, we will discuss two major monitoring approaches: Synthetic Transaction and Real User Monitoring.

 
LVL 19

Expert Comment

by:cheekycj
ID: 6903354
ok try this:
<CFHEADER NAME="content-disposition" VALUE="attachment; filename=whatever.xls">
     <!--- Do all your queries.. form processing etc  --->
     <!--- Set the content type of the file. --->
     <CFCONTENT TYPE="text/tabdelimited">

<!--- output formatted data in a table --->
0
 

Author Comment

by:kari208
ID: 6903357
IE 5.5
0
 

Author Comment

by:kari208
ID: 6903392
That seemed to do the trick EXCEPT that now I'm prompted as to whether I want to save or open. Not a horrible thing, but any way I can get around that??

Thanks so much!
0
 
LVL 19

Expert Comment

by:cheekycj
ID: 6903397
you have to add "text/tabdelimited" as a mime type that is opened by MS Excel..

CJ
0
 

Author Comment

by:kari208
ID: 6903413
That seemed to do the trick EXCEPT that now I'm prompted as to whether I want to save or open. Not a horrible thing, but any way I can get around that??

Thanks so much!
0
 

Author Comment

by:kari208
ID: 6903415
I'm sure I should know how to do that, but I don't...:)
0
 

Author Comment

by:kari208
ID: 6903417
I'm sure I should know how to do that, but I don't...:)
0
 

Author Comment

by:kari208
ID: 6903421
I'm sure I should know how to do that, but I don't...:)
0
 
LVL 19

Expert Comment

by:cheekycj
ID: 6903456
Now This might work without changing any mime types:
<CFHEADER NAME="content-disposition" VALUE="attachment; filename=whatever.xls">
    <!--- Do all your queries.. form processing etc  --->
    <!--- Set the content type of the file. --->
    <CFCONTENT TYPE="application/vnd.ms-excel">

<!--- output formatted data in a table --->

To change/add mime type.
Launch Microsoft Explorer (not Internet Explorer).
From the View menu, choose Options or from the Tools menu, choose Folder Options.
Select the File Types tab.
Click "New"
Add extension "xlc" // you may have to change the extension since xls is taken.
select MS-Excel as the app to open it with.

Also make sure that in the above "File Types" tab.. for file type xls it has open in window selected (should be under Advanced button)

CJ
0
 
LVL 19

Expert Comment

by:cheekycj
ID: 6903461
Please don't hit reload.. it posts the last comment again.. and sends me another email :-)

There is a link on the top of this page.. on the right.. "Reload Question"  Click that to check for updates.

CJ
0
 

Author Comment

by:kari208
ID: 6903490
Sorry about the reload...I noticed that a bit late. :)

This code got me down to one prompt versus two:
<CFHEADER NAME="content-disposition" VALUE="attachment; filename=whatever.xls">
   <!--- Do all your queries.. form processing etc  --->
   <!--- Set the content type of the file. --->
   <CFCONTENT TYPE="application/vnd.ms-excel">

To change the mime type, is there a way this can be done on the server so that I don't require all of my clients to have to change their mime types? If not, perhaps I'm just better off dealing with the prompt.
0
 
LVL 19

Accepted Solution

by:
cheekycj earned 50 total points
ID: 6903533
Not really.. the mime-type.. is set on client's browser or PC.. you really can't control that or change that (too big of security risk).. all you can do is give steps on how to configure it to make it convenient.

CJ
0
 
LVL 19

Expert Comment

by:cheekycj
ID: 6903646
Glad I could help.  Thanx for the "A"
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
When it comes to security, close monitoring is a must. According to WhiteHat Security annual report, a substantial number of all web applications are vulnerable always. Monitis offers a new product - fully-featured Website security monitoring and pr…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question