Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > Reporting Services
|
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 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
 
Old March 22nd, 2006, 04:52 PM
Registered User
 
Join Date: Mar 2006
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


 
Old April 5th, 2006, 09:12 AM
Registered User
 
Join Date: Mar 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default


IS THERE ANY HELP FROM ANYONE????

 
Old May 10th, 2006, 10:31 AM
Registered User
 
Join Date: May 2006
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.
 
Old November 30th, 2006, 08:04 AM
Registered User
 
Join Date: Nov 2006
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





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





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