File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes HTML To excel Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "HTML To excel" Watch "HTML To excel" New topic
Author

HTML To excel

deekasha gunwant
Ranch Hand

Joined: May 06, 2000
Posts: 396
Hi all,
My application (written in java)is generating reports in HTML.I need to add the functionality of exporting or saving this report to excel.
i have absolutely no idea about how to for it.I hope to get help from all u HTML ppl around.(i am barely a novice in html)
eagerly waiting for your response
regards
Deeksha
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
If you did this with JSP you could put the report data into an excel spreadsheet using JDBC and a DSN that points to your spreadsheet.
Lee Clarke
Greenhorn

Joined: Jan 18, 2001
Posts: 18
Here's an easy way to do it if you are doing jsp.
Just print your data into a simple HTML table and up near the top of the jsp change the mime type with this command:

This will cause the browser to open into excel and display the table as a spreadsheet. The user can then save it to their hard drive. This method is somewhat limited but its a quick and easy!
Lee


Lee Clarke - SCJP
deekasha gunwant
Ranch Hand

Joined: May 06, 2000
Posts: 396
Hi,
Thanks Lee and Bodie for the response.
But my html page is generated by a java application(i.e. no web stuff involved)
so how can i do the same via my application?
for details i'd like to mention that
my program programmatically generates html, saves it as an html file at client m/c and then using Runtime.exec open this file in a browser.
now we want to have/open/save/view the same data as an excel sheet.
looking forward for your replies
regards
deeksha
Lee Clarke
Greenhorn

Joined: Jan 18, 2001
Posts: 18
Deekasha,
There is an HTML equilivant to the jsp statement that I posted earlier, I can't remember the details of the statement. I believe it is posted in a meta tag.. something like this:
<meta contentType="application/vnd.ms-excel" >
I could be wrong on this part, I went to look it up and couldn't find it, I think its a meta tag or it goes in the <HEAD> tag. Pretty sure its a meta tag.
Lee
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: HTML To excel