Wrox Programmer Forums
| 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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #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.
  #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>



  #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.
  #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/.
  #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.
  #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.


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





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