daust / JasperReportsIntegration

JasperReportsIntegration provides an interface to use the JasperReports reporting engine in an Oracle database application, specifically with Oracle Application Express (Oracle APEX).
BSD 3-Clause "New" or "Revised" License
55 stars 23 forks source link

jasperreports pdf export encrypted Password Not Working #101

Closed HAfsari closed 2 years ago

HAfsari commented 2 years ago

JasperReportsIntegration Server Error:

image

Development Property Add

image

daust commented 2 years ago

Can you build a simple test case? Need more information. Where and how did you enter those attributes? Are they part of the .jrxml file now?

It seems like a library is missing at runtime.

daust commented 2 years ago

This library is marked as optional. You can add it yourself.

You can:

image

Please upload a simple test case and/or describe in detail what I need to do to build a test case. Also, if you find and integrate the lib successfully, please let me know, I can include it into future releases.

HAfsari commented 2 years ago

Add dependencies > build.gradle file dependencies { //https://mvnrepository.com/artifact/com.itextpdf/itextpdf/5.5.13.2 implementation group: 'com.itextpdf', name: 'itextpdf', version: '5.5.13.2' } @daust Thanks.

daust commented 2 years ago

Please upload a simple test case and/or describe in detail what I need to do to build a test case

I still need that because I am not sure, your suggestion will work. We already have a special version of itext from the JasperReports library which is based on the license-friendly version.

So, I would rather need a test case ... so that I can make sure NOW and in the FUTURE, that everything works as expected.

So, once again ... please a testcase!

daust commented 2 years ago

I have added the dependency and a sample report to the distribution and sample application: demo/encrypt-pdf

daust commented 2 years ago

When you configure the following properties, you can use it in your report:

net.sf.jasperreports.export.pdf.encrypted=true
net.sf.jasperreports.export.pdf.128.bit.key=true
net.sf.jasperreports.export.pdf.user.password=123456
net.sf.jasperreports.export.pdf.owner.password=123456

This can be done through JasperSoftStudio by first selecting the report and then choosing "Advanced > Edit Properties": image

Or you can add these properties directly into the .jrxml file:

    <property name="net.sf.jasperreports.export.pdf.encrypted" value="true"/>
    <property name="net.sf.jasperreports.export.pdf.128.bit.key" value="true"/>
    <property name="net.sf.jasperreports.export.pdf.owner.password" value="123456"/>
    <property name="net.sf.jasperreports.export.pdf.user.password" value="123456"/>