When i exported the xlsx file and opened it,Excel reminds me found the error and need to recover it. Then the file could be opened,but got the warning. The infmation is: A repaired record : The format of the /xl/styles.xml part (style) The Code pasted below: public void generateReportEXCEL (List<JasperPrint> jasperPrintList,String[] names, HttpServletRequest req, HttpServletResponse resp) throws IOException, JRException {resp.reset();resp.resetBuffer();resp.setContentType("application/vnd.ms-excel");resp.setHeader("Content-Disposition", "attachment;filename="test.xlsx"");ServletOutputStream outputStream = resp.getOutputStream(); JRXlsxExporter exporter = new JRXlsxExporter();exporter.setExporterInput(SimpleExporterInput.getInstance(jasperPrintList));exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(outputStream));SimpleXlsxReportConfiguration configuration = new SimpleXlsxReportConfiguration(); configuration.setDetectCellType(true);//Set configuration as you like it!!configuration.setCollapseRowSpan(false);configuration.setWhitePageBackground(false);configuration.setSheetNames(names); exporter.setConfiguration(configuration); exporter.exportReport();outputStream.flush();outputStream.close();}