Subversion Repositories SmartDukaan

Rev

Rev 7453 | Rev 7882 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7453 Rev 7588
Line 276... Line 276...
276
	public void downloadFBASheet() {
276
	public void downloadFBASheet() {
277
		try {
277
		try {
278
			WarehouseService.Client warehouseClient = new WarehouseClient().getClient();
278
			WarehouseService.Client warehouseClient = new WarehouseClient().getClient();
279
			Map<Long, Long> transferLotItems = warehouseClient.getItemsInTransferLot(id);
279
			Map<Long, Long> transferLotItems = warehouseClient.getItemsInTransferLot(id);
280
			
280
			
281
			File fbaSheetFile = new File("transfer-lot-"+id+"-sheet_"+new Date());
281
			File fbaSheetFile = new File("transfer-lot-"+id+"-sheet_"+new Date() + ".xls");
282
			FileOutputStream fStream = null;
282
			FileOutputStream fStream = null;
283
			try {
283
			try {
284
				fStream = new FileOutputStream(fbaSheetFile);
284
				fStream = new FileOutputStream(fbaSheetFile);
285
			} catch (FileNotFoundException e1) {
285
			} catch (FileNotFoundException e1) {
286
				logger.error(e1.getMessage());
286
				logger.error(e1.getMessage());
Line 357... Line 357...
357
            } finally {
357
            } finally {
358
                input.close();
358
                input.close();
359
            }
359
            }
360
 
360
 
361
            response.setContentType("application/vnd.ms-excel");
361
            response.setContentType("application/vnd.ms-excel");
362
            response.setHeader("Content-disposition", "inline; filename="
362
            response.setHeader("Content-disposition", "attachment; filename="
363
                    + fbaSheetFile.getName());
363
                    + fbaSheetFile.getName());
364
 
364
 
365
            ServletOutputStream sos = response.getOutputStream();
365
            ServletOutputStream sos = response.getOutputStream();
366
            sos.write(buffer);
366
            sos.write(buffer);
367
            sos.flush();
367
            sos.flush();