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
posted
0
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
posted
0
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
posted
0
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
posted
0
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