Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > SQL Server > Reporting Services
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Reporting Services SQL Server Reporting Services. Please specify which version.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Reporting Services 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 March 22nd, 2006, 04:52 PM
Registered User
 
Join Date: Mar 2006
Location: , MI, .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Export to Excel as .csv file from JSP

Hello,
I'm trying to export my results to .csv file. The following is the code which I have in my .jsp:

//Send the results to Excel.
//response.setContentType("application/vnd.ms-excel");
response.setContentType("application/x-csv");
response.setHeader("Content-Disposition", "attachment; filename=Excel.csv");

There are 2 problems which I'm facing:
1. The File Download box comes up and when I save file, the results are have all the html tags when I open it in excel.
2. if I open the file, the download box comes up twice, and again it has all the html tags when it opens.

ANY HELP WEILL BE APPRECIATED!

thanks in advance!
Naheed


Reply With Quote
  #2 (permalink)  
Old April 5th, 2006, 09:12 AM
Registered User
 
Join Date: Mar 2006
Location: , MI, .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default


IS THERE ANY HELP FROM ANYONE????

Reply With Quote
  #3 (permalink)  
Old May 10th, 2006, 10:31 AM
Registered User
 
Join Date: May 2006
Location: Buftea, Ilfov, Romania.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to fuzzy
Default

Try it like this:
Code:
response.setContentType("application/vnd.ms-excel");
response.setHeader("Content-disposition","attachment;filename=Export.csv");
Instead of Export.csv you can put your desired filename.

PS: don't be so inpacient when you ask someone to help you FOR FREE. All the help in here can be considered [u]DONATION</u>, so try to behave if you want to get it from now one.

I like money, but I'm not crazy about them. Seems the feeling is mutual.
Reply With Quote
  #4 (permalink)  
Old November 30th, 2006, 08:04 AM
Registered User
 
Join Date: Nov 2006
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to gourav_ajmani
Default

HI Fuzzy ,I have tried what u said to do..That is to add the two lines in JSP..But the problem is when I click on the link which should open Excel sheet .it ask me to save or open the excel file.when i do so it prints the whole jsp page in Excel.

Plz help me on the same

Thanx
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
DataSet export to .csv file snufse1 ASP.NET 2.0 Basics 3 September 22nd, 2008 07:22 AM
Export ALL records from GridView into Excel or CSV kevorkian ASP.NET 2.0 Basics 7 June 17th, 2008 01:28 PM
How to export an image file to excel using jsp sujasuri Other Programming Languages 0 November 15th, 2007 06:16 AM
How To Export a specific Excel Sheet as a csv file mrjits Excel VBA 5 August 1st, 2006 03:04 PM
Export To .csv File paul31Hampshire Access VBA 18 June 26th, 2006 11:30 AM



All times are GMT -4. The time now is 11:40 PM.


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