Jump to content
Changes to the Jaspersoft community edition download ×

Why i got the warning:A record that has been repaired: The format of the /xl/styles.xml part (style)


lswx2016

Recommended Posts

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();

 

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...