sharkoff76 Posted April 21, 2021 Share Posted April 21, 2021 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 More sharing options...
sharkoff76 Posted April 21, 2021 Author Share Posted April 21, 2021 So for generation i use jasperStarterpublic 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 More sharing options...
sharkoff76 Posted April 26, 2021 Author Share Posted April 26, 2021 HelloBy the way, XLSX is archive file, so when i unarchive file i see "unexpected end file" . Seem to be file was corrupted. But after recover process file is good Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now