Re: All my POI built Excel files are suddenly corrupt?
Dominik Stadler <[email protected]> Thu, 10 Oct 2024 14:23:02 +0200
| Newsgroups | gmane.comp.jakarta.poi.user |
|---|---|
| Message-ID | <CABdJj554=UK0kBRRryPFM4GHFOrXUewZYHh7QxATcjgx_Ybt-Q@mail.gmail.com> |
--000000000000378d0e06241e6f6c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Andreas, I did a quick check and can state the following: * It happens for me as well with your code snippet * It does not depend on the version of POI, all versions from 3.17 - 5.3.0 lead to the same * LibreOffice does not complain for the file * When I create a sheet as part of the code, the problem goes away So it seems Excel complains when there is no sheet at all in the file. Might this be the case in your application in some cases? Or is there something else which is not covered in the test-case yet? *BTW, the sample file did not make it through the mailing-list...* Regards... Dominik. On Thu, Oct 10, 2024 at 6:53=E2=80=AFAM Andreas Reichel < [email protected]> wrote: > Greetings team and compliments of the day. > > Since a few month, all our POI-built Excel files are corrupted when > opening in LibreOffice and/or Excel: > > > Although the file can be repaired and opened without any noticeable damag= e. > The weird thing is: Our Excel export code as not changed at all since, an= d > all the Excel files fail even from various, different and independent cod= e > paths. Also tested on different machines. > > I have also checked, how we write and close those files -- it looks all > innocent and normal to me: > > SXSSFWorkbook wb =3D new SXSSFWorkbook(new XSSFWorkbook(), 100, true, tr= ue); > > File outputFile =3D File.createTempFile("test", ".xlsx"); > > FileOutputStream fileOutputStream =3D new FileOutputStream(outputFile); > wb.write(fileOutputStream); > wb.close(); > > > So I don't even know where/what to look for? > > Can you give me some advise how to trace this problem. I have attached > such an Excel, just in case. > The used libraries and dependencies are shown below. > > Any hint would be much appreciated! > Thank you, all the best and cheers > > Andreas > > > - > - *com.github.pjfanning:excel-streaming-reader:5.0.2* > - *commons-codec:commons-codec:1.17.1 * > - *commons-io:commons-io:2.17.0 * > - commons-logging:commons-logging:1.3.2 > - org.apache.commons:commons-collections4:4.5.0-M2 > - *org.apache.commons:commons-compress:1.27.1 (*) * > - org.apache.commons:commons-configuration2:2.11.0 > - *org.apache.commons:commons-lang3:3.17.0 * > - org.apache.commons:commons-math3:3.6.1 > - org.apache.commons:commons-text:1.12.0 (*) > - *org.apache.poi:poi-ooxml:5.3.0 * > - *org.apache.poi:poi:5.3.0 * > - > > > --000000000000378d0e06241e6f6c--