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