Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Problem in exporting HTML contents to EXCEL page using JSP

Reply
Thread Tools

Problem in exporting HTML contents to EXCEL page using JSP

 
 
SMuthaiyan@inautix.com
Guest
Posts: n/a
 
      06-07-2005
Hi,

I am trying to create a EXCEL sheet in a jsp program.
Say the jsp program is CallExcel.jsp

I am using response.setContentType("application/vnd.ms-excel");
to make the content type as excel.

The link which calls the CallExcel.jsp is like
http://<ip.address>:8080/<root folder>/CallExcel.jsp?&obj=<value> Where
obj is the parameter being passed to the jsp page.
When I try the link it is trying to open a file with the name
CallExcel.jsp?&obj=<value> and not as CallExcel.xls
We are having EXCEL 2002 in our machine. And I am not able to open the
file. I don't know what is the problem.
Waiting for the response.

Thanks

 
Reply With Quote
 
 
 
 
Rivky
Guest
Posts: n/a
 
      06-08-2005
try setting this as well

response.setHeader("Content-disposition","attachment;
filename=CallExcel.xls" );
or
res.setHeader("Content-disposition","inline; filename=CallExcel.xls");

depending on wether you want excel to launch(attachemnt) or you want
the excel sheet result within the browser (inline)

 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Exporting to Excel using new version of Excel Doogie ASP .Net 1 11-19-2008 09:10 PM
Exporting contents of JSP to Powerpoint judiphuongtu@yahoo.com Java 6 03-30-2005 06:28 PM
exporting an excel file from database; making changes to excel file and updating the database by importing it back Luis Esteban Valencia ASP .Net 1 01-12-2005 12:28 AM
How to get the html output of a local JSP page from my Java code, or use a JSP as an HTML templates. DigitalUncle Java 0 11-02-2004 05:22 PM
Exporting data to Microsoft Excel from a Web Form (using OWC) problem sarah5e@yahoo.com ASP .Net 1 05-10-2004 01:45 PM



Advertisments