Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Classic ASP Professional For advanced coder questions in ASP 3. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Professional section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old December 17th, 2005, 10:27 AM
Registered User
Points: 1,897, Level: 17
Points: 1,897, Level: 17 Points: 1,897, Level: 17 Points: 1,897, Level: 17
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2005
Location: Mumbai, Maharastra, India.
Posts: 352
Thanks: 14
Thanked 0 Times in 0 Posts
Send a message via Yahoo to rupen
Default Problem while exporting.

Hi all,
I m using below line in ASP page which i want to export:
<% Reponse.ContentType="appliation/vnd.ms-excel" %>
and using <table>..i m getting nice export utility.

The problem is that some users gets message from IE whether they want to open/save or cancel the file,(this is what i want so it is fine),but for some users it directly open an excel sheet in browser window and starts displaying data..and this is what i don't want to happen.

Assume that i m targeting only IE users.

Any suggestion? idea?


Rupen Anjaria.:)
------------------
We CAN'T avoid problems, but can solve it.
Reply With Quote
  #2 (permalink)  
Old December 17th, 2005, 12:10 PM
Registered User
 
Join Date: Dec 2005
Location: waalwijk, nb, Netherlands.
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

dear rupe,

all you have to do to make sure donwnloading begins, is add this to you code :
response.AddHeader "Content-Disposition", "attachment; filename=" & <addfilename here>



Reply With Quote
  #3 (permalink)  
Old February 15th, 2006, 11:38 AM
Registered User
Points: 1,897, Level: 17
Points: 1,897, Level: 17 Points: 1,897, Level: 17 Points: 1,897, Level: 17
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2005
Location: Mumbai, Maharastra, India.
Posts: 352
Thanks: 14
Thanked 0 Times in 0 Posts
Send a message via Yahoo to rupen
Default

this is not working...if so where the file will be store? I want to ask user where he would like to store the file.

Rupen Anjaria.:)
------------------
We CAN'T avoid problems, but can solve it.
Reply With Quote
  #4 (permalink)  
Old February 15th, 2006, 08:08 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: High Wycombe, UK, United Kingdom.
Posts: 344
Thanks: 0
Thanked 1 Time in 1 Post
Default

This is a configuration on the local machine and can NOT be controlled by the browser/webserver - as long as you server known supported MIME types as in your example. See http://support.microsoft.com/kb/q162059/ for more details on what you need to amend on the client machines for this to work.

Other options include providing an unknown MIME type, so they will always be prompted to download or ZIPping the contents and sending that back as a ZIP file.

This is covered in http://www.greggriffiths.org/webdev/both/excel/.
Reply With Quote
  #5 (permalink)  
Old February 22nd, 2006, 02:39 AM
Registered User
Points: 1,897, Level: 17
Points: 1,897, Level: 17 Points: 1,897, Level: 17 Points: 1,897, Level: 17
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2005
Location: Mumbai, Maharastra, India.
Posts: 352
Thanks: 14
Thanked 0 Times in 0 Posts
Send a message via Yahoo to rupen
Default

Great... Excellent!!!!! Thank you very much sir.

Rupen Anjaria.:)
------------------
We CAN'T avoid problems, but can solve it.
Reply With Quote
  #6 (permalink)  
Old March 6th, 2006, 04:38 PM
Registered User
Points: 1,897, Level: 17
Points: 1,897, Level: 17 Points: 1,897, Level: 17 Points: 1,897, Level: 17
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2005
Location: Mumbai, Maharastra, India.
Posts: 352
Thanks: 14
Thanked 0 Times in 0 Posts
Send a message via Yahoo to rupen
Default

Hey Greg,
Right now, the exported file name is taken as .asp file's name, but my user wants to have file name something different, So, do u know any "know how" for this??
Thanks in advance.

Rupen Anjaria.:)
------------------
We CAN'T avoid problems, but can solve it.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with exporting zaghmout ASP.NET 2.0 Professional 4 September 12th, 2007 04:07 AM
problem exporting to excel neversummer84 Classic ASP Databases 1 June 15th, 2006 12:55 PM
Problem Exporting Data... mat41 SQL Server 2000 1 September 29th, 2005 08:35 PM
problem exporting datagrid to excel kscdave Classic ASP Professional 0 March 29th, 2005 11:57 AM
Problem in exporting data to PDF vasansrini Crystal Reports 1 December 10th, 2004 11:48 AM



All times are GMT -4. The time now is 05:59 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.