Good afternoon, tell me, please, how to get to save the excel file generated on the server to the client's computer?
HSSFWorkbook workbook = new HSSFWorkbook(); HSSFSheet sheet = workbook.createSheet("FirstSheet"); List<Material>materials = materialDAO.getMaterialsList(); HSSFRow rowhead = sheet.createRow((short)0); rowhead.createCell(0).setCellValue("№ з/п"); rowhead.createCell(1).setCellValue("Назва"); rowhead.createCell(2).setCellValue("Кількість"); rowhead.createCell(3).setCellValue("Од.вим."); for(int i=1;i<materials.size();i++){ HSSFRow row = sheet.createRow((short)i); row.createCell(0).setCellValue(i); row.createCell(1).setCellValue(materials.get(i-1).getTitle()); row.createCell(2).setCellValue(materials.get(i-1).getNumber()); row.createCell(3).setCellValue(materials.get(i-1).getUnity()); } FileOutputStream fileOut = new FileOutputStream(filename); workbook.write(fileOut); fileOut.close(); System.out.println("Your excel file has been generated!");