Jump to content
We've recently updated our Privacy Statement, available here ×

Incorrect xlsx


sharkoff76

Recommended Posts

Hello 

Im using library jasperreports-6.16.0 jar for generate huge xlsx report.

When i open file with xlsx i get warning : 

 

A file-level check was performed and then the file was restored. Some fragments of the document could be restored or deleted.

I open errr log

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<recoveryLog xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
    <logFileName>error049160_02.xml</logFileName>
    <summary>Обнаружены ошибки в файле "C:UsersxxxDownloadsSHEET_ACCNTS_21042021_042302.xlsx"</summary>
    <additionalInfo>
        <info>A file-level check was performed and then the file was restored. Some fragments of the document could be restored or deleted.</info>
    </additionalInfo>
</recoveryLog>

What's happend and where i have to check code?

After Excel check i can save report and i see it's OK.

Please help!

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

So for generation i use jasperStarter

public void exportXlsx() throws JRException {
        Map<String, String> dateFormats = new HashMap<String, String>();
        dateFormats.put("EEE, MMM d, yyyy", "ddd, mmm d, yyyy");

        JRXlsxExporter exporter = new JRXlsxExporter();
        SimpleXlsxReportConfiguration repConfig = new SimpleXlsxReportConfiguration();
        exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
        exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(getOutputStream(".xlsx")));
        repConfig.setDetectCellType(Boolean.TRUE);
        repConfig.setFormatPatternsMap(dateFormats);
        exporter.setConfiguration(repConfig);
        exporter.exportReport();
    }

 

 

 

Link to comment
Share on other sites

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...