Generate MS Excel File through Java

How do i generate excel file using java ? How to export data in excel format ? Dynamic - on the fly excel file creation ?

Well, I also had the same questions and the answers found are below....

We can use JExcel API , This is an easy way for stand alone application to create dynamic excel file....

Secondly, we use use any web server scripts to create excel file, i took jsp/servlets (since i was working on that)... below is the example code....

<%
response.setHeader("Content-type","application/xls");
//response.setContentType("application/vnd.ms-excel");
response.setHeader("Content-disposition","inline; filename=FileName.xls");

out.write("<table>");
out.write("<tr><td STYLE=\"vnd.ms-excel.numberformat:dd-mmm-yyyy\">12/28/2005</td></tr>");
out.write("</table>");

%>

For other mime types check http://www.w3schools.com/media/media_mimeref.asp



Save This Page Save This Page Digg!

Comments
Personal information





Remember your information?
Comment

To prevent automated commentspam we require you to answer this silly question
 


Small print: All html tags except <b> and <i> will be removed from your comment. You can make links by just typing the url or mail-address.