Hi Jose,

you've noticed before that OPCPackage has a problem with the jasper output, so 
don't use it for now.

When you write "POIFSFileSystem fs = new POIFSFileSystem(inputStream);" what is 
inputStream refering to?
Just try it without the inputStream:

JRXlsAbstractExporter exporter = new JRXlsxExporter();
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
...
exporter.setParameter(JRXlsExporterParameter.OUTPUT_STREAM, outputStream);
....
exporter.exportReport();

POIFSFileSystem fs = new POIFSFileSystem();
EncryptionInfo info = new EncryptionInfo(fs, EncryptionMode.agile);
Encryptor enc = info.getEncryptor();
enc.confirmPassword("testPass");

OutputStream os = enc.getDataStream(fs);
outputStream.writeTo(os);

FileOutputStream encryptedXlsx = new FileOutputStream("test.xlsx");
fs.writeFilesystem(encryptedXlsx);
encryptedXlsx.close();

If this also doesn't work, please send me the unencrypted xlsx to my private 
email address and I'll have a look, what's wrong with it.

Best wishes,
Andi



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to