Jump to content

Excel with READONLY permission


atharindhi

Recommended Posts

Hi all

I want to generate a Excel report using i-Report tool.
But this generated report should be read-only file..(User can't change anythis but view it)
Can anyone help me with the coding..

I want to do this badly...
 



Post Edited by atharindhi at 08/25/2010 10:41
Link to comment
Share on other sites

  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

It's so beautiful try to find new checkbox in the menu... and I'm not speaking of hidden menu... but simple menu :)

try to do this from the ireport interface:

Tools->Option->Ireport->ExportOption->Pdf->Encryption...



this is the menu item... try to make some tests... I think that not all checks work in the right manner.

_________________________________________

if you like it... give me KARMA points please!    : ) 

_________________________________________
 
listening:   Nine Inch Nails - Only

Link to comment
Share on other sites

Oh...!
Sorry for the misunderstanding...

in this case you can set a lot of parameters for the pdf exportation.
take a look at this code for an idea:

.....
.....
import net.sf.jasperreports.engine.export.JRPdfExporter;
import net.sf.jasperreports.engine.export.JRPdfExporterParameter;
import com.lowagie.text.pdf.PdfWriter;
....
....

JRPdfExporter exp = new JRPdfExporter();

exp.setParameter(JRPdfExporterParameter.IS_128_BIT_KEY, Boolean.TRUE);
exp.setParameter(JRPdfExporterParameter.IS_ENCRYPTED, Boolean.TRUE);
exp.setParameter(JRPdfExporterParameter.USER_PASSWORD, "user_pwd");
exp.setParameter(JRPdfExporterParameter.OWNER_PASSWORD, "owner_pwd");
exp.setParameter(JRPdfExporterParameter.PERMISSIONS,new Integer(PdfWriter.ALLOW_COPY|PdfWriter.ALLOW_PRINTING) );

 

take a look here:
http://jasperreports.sourceforge.net/api/net/sf/jasperreports/engine/export/JRPdfExporterParameter.html

and here: (some concepts involve IText library...)
http://api.itextpdf.com/com/itextpdf/text/pdf/PdfWriter.html

if you make some google search you can find examples regarding iText pdf encryption (http://www.itextpdf.com/examples/index.php?page=example&id=219 ) or jasperReport simpler code method to so this.

I hope this may help ... good work :)
leave us feedback!

_________________________________________

if you like it... give me KARMA points please!    : ) 
_________________________________________

listening:  Almamegretta E'guagliun d'o Sole

"young fellah young fellah
keep on fighting keep on fighting
young fellah young fellah
stay united stay united" (a.)
 

 

Link to comment
Share on other sites

Hi again..
Thanx for the wonderful help u gave..
But using that code i only can set a pass word to the PDF..
Still text can copy (Im using Adobe Reader 6.0 and Foxit Reader to open PDF) using my PDF softwares..
How can i prevent this...

Im attaching my code below..
Help me...

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...