Export to excel file taking long time when trying to open
I am exporting grid(jqgrid 3.8.3) in spring mvc application to excel using
XSSFWorkbook Apache POI, the export method works well when I select the
'Save As' option, but instead if I select the 'Open' option, the method is
executed many times, strucking up the application! plz let me know if
there is wrong in my below code?
@RequestMapping(value = "/ExportAdminUserInfo.htm", method =
{RequestMethod.GET, RequestMethod.HEAD})
public @ResponseBody ProjectResponse
exportToExcel(HttpServletRequest request,HttpServletResponse
response) throws SpringException {
List<ManageMasterUserDTO> exportUserListOfEPRT = null;
response.setContentType("application/vnd.ms-excel");
response.setHeader("Content-Disposition", "inline; filename="
+ "excel1.xlsx");
System.out.println("Excel written successfully..");
try{
XSSFWorkbook workbook = new XSSFWorkbook ();
XSSFSheet sheet = workbook.createSheet("Sample sheet");
exportUserListOfEPRT =
masteruserservice.fetchTableDetailsForExport();
int rownum = 0;
XSSFRow row = null;
XSSFCell cell = null;
row = sheet.createRow(rownum);
No comments:
Post a Comment