<% FileOutputStream fout = new FileOutputStream("./test.xls"); HSSFWorkbook wb = new HSSFWorkbook(); HSSFSheet s = wb.createSheet(); HSSFRow r = null; HSSFCell c = null;
for(int i = 0;i < 10;i++) { r = s.createRow((short)i); for(int j = 0;j < 10;j++) { c = r.createCell((short)j); c.setCellValue(""+i+j); } } wb.write(fout); fout.close(); response.sendRedirect("./test.xls"); %>
FileOutputStream fout = new FileOutputStream("./test.xls");
HSSFWorkbook wb = new HSSFWorkbook();
HSSFSheet s = wb.createSheet();
HSSFRow r = null;
HSSFCell c = null;
for(int i = 0;i < 10;i++)
{
r = s.createRow((short)i);
for(int j = 0;j < 10;j++)
{
c = r.createCell((short)j);
c.setCellValue(""+i+j);
}
}
wb.write(fout);
fout.close(); response.sendRedirect("./test.xls");
%>