File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HTML To excel

 
deekasha gunwant
Ranch Hand
Posts: 396
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 18944
  • 0
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 18
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
deekasha gunwant
Ranch Hand
Posts: 396
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 18
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic