Problem in exporting HTML contents to EXCEL page using JSP

S

SMuthaiyan

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
 
R

Rivky

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top