Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I embed excel sheet in JSP 1

Status
Not open for further replies.

jollyplay

Programmer
Dec 16, 2003
90
Hi,

I want to embed the excel sheet in my JSP page. I don't know how to embed it. I'm using IFrame to include an excel sheet.It display the values but i need the look and feel as excel sheet. I need to manipulate the data in the excel sheet.
Kindly help me.

Thanks in advance.
 
I think if you set the content type as "application/excel" or something like that, and then dump the spreadsheet byte data to the response stream, IE will invoke Excel to open the spreadsheet.

--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
Stating the browser is IE and stating that the browser settings are to do that and not to save the file or to open in outside the browser ...

Cheers,
Dian
 
Thanks sedj and Diancecht.

I want to do the calculation(like formula) in the excel sheet which I'm displaying in the JSP page. So I need the excel sheet as it is with the equation bar. In HTML using <iframe> I'm able to open the excel sheet but in jsp it just displays the data in the sheet.(Also in the HTML while opening IE retricts it and we have to click the information bar to open the worksheet.)

Pls give me some idea about this.

Thank you once again.
 
JSP just outputs HTML. If you have the HTML as you need, you just need to change the iframe so instead of opening a local excel file makes a call to whichever component is generating that file in the server.

Cheers,
Dian
 
Thank you Dian.

One more thing if we open the HTML file(normally by dblclicking) the page is opened with the excel format including formula bar. I can manipulate the data

When I request this HTML file via Tomcat it just displays the data which is in the excel sheet. I cannot manipulate the data. I don't know why. Kindly give me some idea to solve this issue.

Thanks.
 
Sorry Dian I didn't understand your question.

Thanks.
 
I'll rewrite the question:

The data is displayed as normal data (like html) or is displayed inside an Excel sheet embedded in the browser (Excel plugin)?

Cheers,
Dian
 
Hi Dian,

Data are displayed as normal not inside the excel sheet.

Thanks.
 
I think your servlet is returning a regular html file with a table inside instead of the iframed one with the xls file embedded.

Cheers,
Dian
 
Hi Dian,

This is my simple jsp code.

<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<html>
<head><title>Excel</title></head>
<body>
<iframe src="/sample/sheet/bbtents.xls" width='100%' height='100%' frameborder=1>
</body>
</html>

Thanks.
 
And the data is displayed as pure HTML? Hard to believe, dude ...

What shows the source code on the browser?

Cheers,
Dian
 
Hi Dian,

Yes the data is displayed as a HTML.

Thanks
 
Can you post a URL to your online version? I find it very hard to believe that an Excel file is being delivered as HTML. Perhaps you are mistaken about this, or about the fact that it is an Excel file (maybe it's erroneously got a .xls extension - try opening it in a text editor like Notepad and see what you get).

Dan



[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
No I have not yet got any solution.

I want to open excel in jsp page with other jsp components like buttons in the same browser.

Thanks in advance.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top