I was asked to add the average amount of data from my web application (basically a list from SQL) to the Excel download file, so I made a servlet to create Excel.
The problem is that the jxl API does not seem to be more than 256 lines, and my data is more than a thousand.
Is there a way around this limitation? I would like to continue to use this API if I could (there is no need to install various APIs on the server and its ease of use). But I will change if necessary.
Thanks everyone!
PS: here is the main servlet code:
List<TableProject> sql = (List<TableProject>)session.getAttribute("sql"); response.setContentType("application/vnd.ms-excel"); response.setHeader("Content-Disposition", "attachment; filename=Export.xls"); w = Workbook.createWorkbook(response.getOutputStream()); s = w.createSheet("Consult Project", 0); for(int i=0;i<sql.size();i++){ s.addCell(new Label(i,0,sql.get(i).getCod_project())); s.addCell(new Label(i,1,sql.get(i).getTxt_project())); s.addCell(new Label(i,2,sql.get(i).getDate_notification())); s.addCell(new Label(i,3,sql.get(i).getDate_last_action())); s.addCell(new Label(i,4,sql.get(i).getTxt_personal())); s.addCell(new Label(i,5,sql.get(i).getTxt_estate())); s.addCell(new Label(i,6,sql.get(i).getTxt_provider())); } w.close(); w = null;
source share