How do I export an html table to excel without ActiveX?

I write in JAVA and have gotten an html table to export to excel using Active X and javascript, but the computer's that are going to be using my export can't use Active X, so I need another way.  My goal is to generate a table, which i have, have an 'export to excel' button, and when it's clicked, transfers the table data to excel for manipulation/saving..etc...any suggestions?
mcgrindAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Gibu GeorgeChief Technology OfficerCommented:
You can do this easily if you use display tag to build the table.
http://displaytag.sourceforge.net/1.2/
0
RamanhpCommented:
Include the following code in the .jsp page that generates the report/HTML page:


      String mimeType = "application/vnd.ms-excel";
      response.setContentType(mimeType);      
fyi..

http://www.devx.com/tips/Tip/21382



0
Gibu GeorgeChief Technology OfficerCommented:
String mimeType = "application/vnd.ms-excel";
      response.setContentType(mimeType);  

This will export the entire jsp page to an excel file.

I think mcgrind want only the table in the page to be exported.
0
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

Gibu GeorgeChief Technology OfficerCommented:
The display tag provides you with options to export to excel, which is built into it.
0
Murali MurugesanFull stack Java developerCommented:
you can use display tag if you have the luxuy of time to understand and implement the little API.
if not as @Ramanhp: mentioned use the content type and create your table on an individual jsp .When opening it,it is rendered as excel.

<html>
<head>
      response.setContentType("application/vnd.ms-excel");
     response.setheader(inline/attachment,file.xls) <make sure u corect the syntax>
</head>
<body>
           <table>
                 <tr><td></td></tr>
..........................
           </table>
</body>
</html>    

This would render your table contents in excel format.

-Murali*
     
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Murali MurugesanFull stack Java developerCommented:
response.setContentType("application/vnd.ms-excel");
      response.setHeader("Content-disposition","attachment;filename=report.xls");      

just corrected the syntax.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
HTML

From novice to tech pro — start learning today.