Subversion Repositories SmartDukaan

Rev

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

Rev 23765 Rev 23766
Line 55... Line 55...
55
		}
55
		}
56
		HttpHeaders headers = new HttpHeaders();
56
		HttpHeaders headers = new HttpHeaders();
57
		InputStreamResource is = new InputStreamResource(response.getEntity().getContent());
57
		InputStreamResource is = new InputStreamResource(response.getEntity().getContent());
58
		headers.set("Content-Type", "application/vnd.ms-excel");
58
		headers.set("Content-Type", "application/vnd.ms-excel");
59
		headers.set("Content-disposition",
59
		headers.set("Content-disposition",
60
				"inline; filename=report-" + is.getFilename() + ".csv");
60
				"inline; filename=report-" + fileName + ".csv");
61
		headers.setContentLength(is.contentLength());
61
		headers.setContentLength(response.getEntity().getContentLength());
62
		return new ResponseEntity<InputStreamResource>(is, headers, HttpStatus.OK);
62
		return new ResponseEntity<InputStreamResource>(is, headers, HttpStatus.OK);
63
	}
63
	}
64
 
64
 
65
	@RequestMapping(value = "/reports/", method = RequestMethod.GET)
65
	@RequestMapping(value = "/reports/", method = RequestMethod.GET)
66
	public String reports(Model model) throws ProfitMandiBusinessException, UnsupportedOperationException, IOException {
66
	public String reports(Model model) throws ProfitMandiBusinessException, UnsupportedOperationException, IOException {