Greetings

I am trying to encrypt a file I exported using the jasper reports library. I am 
using the OPCPackage as the Apache POI site recommends. A tutorial using the 
code from the site is here: 
http://www.quicklyjava.com/create-password-protected-excel-using-apache-poi/ .

I am able to open the file however the class field packageProperties is not set 
because it cannot find the 
'application/vnd.openxmlformats-package.core-properties+xml'. part. So he issue 
is that when I try to save the file it throws an exception because 
OPCPackage.packageProperties is null from trying to find the part: 
'application/vnd.openxmlformats-package.core-properties+xml'.

If I save the file from Excel, the library works correctly. Running it through 
libreoffice allows for the file to work as well.

I asked the question in stackoverflow ( 
http://stackoverflow.com/questions/28593223/apache-poi-opcpackage-unable-to-save-jasper-report-generated-xlsx
 ) and a user response says it is POI that is the issue, I think that Jasper 
Reports may be the culprit for not including the core-properties.

My question is, is there a workaround for this within the Apache POI library?

I am currently using version 3.11. The classes in question are OPCPackage (used 
to open the file/stream) and ZipPackage (to save the file after encryption 
#saveImpl)

Thank you!


Reply via email to