• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

HTML To excel

 
Ranch Hand
Posts: 396
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic