Hello!
I was asked to add an average amount of data from my web-app (basically a List from a SQL) into a downloadable Excel file, so I did a servlet to generate the Excel.
Problem is that jxl API doesn’t seem to like more than 256 rows, and my data is more than a thousand.
Is there any way to go around this limitation? I would like to keep using this API if I could (no need to install different APIs in the server and it’s easy to use). But I will change if I must.
Thanks for all!
PS: here is the main code of the servlet:
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;