-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create xlsx Excel file #6174
base: main
Are you sure you want to change the base?
Create xlsx Excel file #6174
Conversation
The CI failure is unrelated to this PR (which looks nice, but I did not test it). As you are still working on this PR, I suggest to fix the typo in the commit message (xslx -> xlsx). |
6f21112
to
f911ce2
Compare
Hmm, i cannot make it work with Apache POI > 5.2.3. (see #6266) The newer version brought a lot of dependency updates (https://poi.apache.org/changes.html) and my Pull Request does not work anymore. (Excel file is empty, PDF works) |
This could be a nasty (transitive) dependency issue involving Apache commons compress. POI 5.2.5 requires commons-compress 1.25.0, on my system i still found some older binaries, which seem to be generated when doing mvn clean install.
Old version seems to come from plexus-archiver: https://mvnrepository.com/artifact/org.codehaus.plexus/plexus-archiver/4.8.0 enforcing commons-compress 1.25.0 fixes the issue
Dependency check after fix:
Edit: to also adress a CVE in commons-compress. https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-26308 |
f911ce2
to
26b2215
Compare
wb.write(out); | ||
wb.close(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wb.close() now also deletes temporary files from disk. https://poi.apache.org/changes.html#5.3.0
@@ -1587,6 +1585,7 @@ public void generateResultAsPdf(String filter, boolean showClosedProcesses, bool | |||
} | |||
|
|||
document.close(); | |||
wb.close(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wb.close() now also deletes temporary files from disk. https://poi.apache.org/changes.html#5.3.0
resolves #6172
This PR changes the used classes in order to create xlsx files when exporting an Excel file to be compatible with newer Excel versions.
I am using SXSSFWorkbook to generate Excel and PDF files, which has a lower memory footprint by flushing intermediary files to disk. See: https://www.baeldung.com/java-apache-poi-workbook-evaluation
This will hopefully enable exporting even longer lists of processes to Excel in the future.
The dependency issues described in this PR were resolved by #6362