posted 17 years ago
using jxl.write, just export to excel then print.
Already you are having jsp display data in the List isn't, use that data, Export to excel.
The example code something like this.
response.setContentType("application/vnd.ms-excel;charset=UTF-8");
response.setHeader("Content-Disposition", "attachment;filename=dfs.xls");
WritableWorkbook w = Workbook.createWorkbook(response.getOutputStream());
WritableSheet s = w.createSheet("sheet name", 0);
WritableFont wfTitle = new WritableFont(
WritableFont.ARIAL, 14);
Label l1;
WritableCellFormat cfTitle = new WritableCellFormat(wfTitle);
l1= new Label(0,0,"abc",cfTitle);
s.addCell(l1);