POI is the Apache Software Foundation project for Java access to Microsoft file formats. This page is a good starting point. Several file formats, including Excel, are addressed. If your spreadsheet is relatively simple, consider comma separated variable (CSV) text output which Excel can easily read. Bill
What I need is user inputed search criteria, Servlet go to Oracle to get the result and output reports in excel format, since output are report, they do need formatting. Also, one important issue why I need more than one spreadsheet is because Excel have 65535 rows limit, if data is more than 65535 rows, then it will have problem..
// Create a row and put some cells in it. Rows are 0 based. HSSFRow row = sheet.createRow((short)0);
// Create a cell and put a value in it. HSSFCell cell = row.createCell((short)0);
// Or do it on one line. row.createCell((short)1).setCellValue(1.2); row.createCell((short)2).setCellValue("This is a string"); row.createCell((short)3).setCellValue(true); // Write the output OutputStream out = response.getOutputStream(); wb.write(out); out.close(); }