I have problem related to file protection when changed the Jasper Report output from xls to xlsx.
The changes is needed since XLSX could support greater row (Up to 1.000.000) compared to XLS.
The problem is the report need to be protected. This is an easy task since Jasper Configuration support this by using
<property name="net.sf.jasperreports.export.xls.password" value="password" />
But This doesn’t work when the output is XLSX, i try to use trivial such as change from xls to xlsx and the result is remain the same.
<property name="net.sf.jasperreports.export.xlsx.password" value="password" />
How to protect Jasper Generated Report when using XLSX as output?
As you can make yourself (after digging in JR sourcecode) only JExcelApiExporter and JExcelApiMetadataExporter classes use
net.sf.jasperreports.export.xls.passwordproperty. And only this two exporters (not JRXlsxExporter and not even JRXlsExporter) can set password.The snippet from net.sf.jasperreports.engine.export.JExcelApiExporter:
You can write your own XlsxExporter.
The JRXLSExporter uses POI library and the JExcelApiExporter uses the JExcelApi.