sarita333 Posted January 5, 2011 Share Posted January 5, 2011 HiiiI have created a jasper report using IReport and I can generated a pdf in my JAVA application.but i want to save this PDF on server .Is there any way to save pdf file generated by Jasper report to save automatically on disk ?Plz help me Link to comment Share on other sites More sharing options...
shivamadagani Posted January 5, 2011 Share Posted January 5, 2011 try this code by overridding postProcessReport method.Code:@Override protected void postProcessReport(JasperPrint populatedReport, Map model) throws Exception { System.out.println("Inside postProcessReport"); super.postProcessReport(populatedReport, model); System.out.println("start download"); JRPdfExporter exporterPdf = new JRXlsExporter(); exporterPdf.setParameter(JRXlsExporterParameter.JASPER_PRINT, populatedReport); exporterPdf.setParameter(JRXlsExporterParameter.IS_REMOVE_EMPTY_SPACE_BETWEEN_ROWS,Boolean.TRUE); exporterPdf.setParameter(JRXlsExporterParameter.IS_REMOVE_EMPTY_SPACE_BETWEEN_COLUMNS,Boolean.TRUE); //exporterPdf.setParameter(JRXlsExporterParameter.IS_WHITE_PAGE_BACKGROUND,Boolean.FALSE); exporterPdf.setParameter(JRXlsExporterParameter.OUTPUT_FILE_NAME, "D:/filename.pdf" ); exporterPdf.exportReport(); System.out.println("End download"); } Link to comment Share on other sites More sharing options...
sarita333 Posted January 5, 2011 Author Share Posted January 5, 2011 Thank you much mamGod bless you Link to comment Share on other sites More sharing options...
brijesh989 Posted July 17, 2019 Share Posted July 17, 2019 Can You show how to dowload it from web browser. 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