atharindhi Posted August 25, 2010 Share Posted August 25, 2010 Hi allI 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 More sharing options...
atharindhi Posted August 26, 2010 Author Share Posted August 26, 2010 I want not to allow users to copy or print the Generated PDF using i-report.How can i pass parameters for that..Help me witha tutorial or a coding..Thanx.. Link to comment Share on other sites More sharing options...
slow Posted August 26, 2010 Share Posted August 26, 2010 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 More sharing options...
atharindhi Posted August 27, 2010 Author Share Posted August 27, 2010 Thanx for the help..But i know dat option and i want to to this using a code..I mean in a servlet..So i want a code segment which will explain this or a tutorial...Thanx in advance Link to comment Share on other sites More sharing options...
slow Posted August 27, 2010 Share Posted August 27, 2010 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.htmland here: (some concepts involve IText library...)http://api.itextpdf.com/com/itextpdf/text/pdf/PdfWriter.htmlif 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 fellahkeep on fighting keep on fightingyoung fellah young fellahstay united stay united" (a.) Link to comment Share on other sites More sharing options...
atharindhi Posted September 2, 2010 Author Share Posted September 2, 2010 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now