Jump to content

Need a Help in generating a PDF file


Recommended Posts


My problem is that ,i have a genrated a report..But my problem is How to run report in a pdf..Right now wht i'm exactly doing is



JasperReport oJasperReport = JasperCompileManager.compileReport(reportSource);

JasperPrint oJasperPrint = JasperFillManager.fillReport(oJasperReport, oParms, iConn);

JasperExportManager.exportReportToPdfFile(oJasperPrint, reportDest);


Where the reportDest is where the pdf is stored ,but i don't want to have reportDest where i want runtime only show the result in a PDF ..Right now the problem for me is i'm unable to update the PDF..The first generated pdf is showing for each and every record..Just send a code to generate a pdf runtime ..

Actully i'm new JasperReports

Thanking You

Link to comment
Share on other sites

  • 2 weeks later...
  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic



If you are talking about a Web application and you want to deliver PDF to the browser directly, without using files on disk, then you need to look at the /demo/samples/webapp sample provided with our project and see what we do there. We use a servlet to deliver PDF content directly to the browser.


If you still think you need to work with files on disk, I don't see why the file does not get replaced, when you call the PDF generating process the second time. Maybe the file is still open in the Acrobat Reader and an exception occurs?


I hope this helps.


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...