File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Other Open Source Projects and the fly likes Jasper usage in J2EE Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "Jasper usage in J2EE" Watch "Jasper usage in J2EE" New topic

Jasper usage in J2EE

Ranjith Kodikara

Joined: Sep 03, 2002
Posts: 15
I am evaluating Jasper for some of my future projects. I want to know whthwe Jasper can be used inside Tomcat or other servlet container to present report to users. In an standalone application, I can generate a .pdf type report to a directory of OS. If I use a servlet, will I be able to give the .pdf report as the servlet output? (This is like setting contentType we can out put an xml file instead of html. Like that can we give the .pdf report as output??). If you have sample source code, it will be fine too.

I would be grateful for your help and it's very much appreciated.

Thanks and best regards,
Paul Clapham

Joined: Oct 14, 2005
Posts: 19973

Yes, you can output PDF from a servlet as well. Your content type would be "application/pdf".

And I had a quick look at the Jasper Reports documentation page which has a link to this article about Jasper Reports in J2EE.
Ranjith Kodikara

Joined: Sep 03, 2002
Posts: 15
Thank you very much Paul. I read the article you reffered and it contains the information I requested. Your help is very much appreciated.

When further looking at this matter, I found that there is a webapp folder in Jasper sample applications. Its coming with the Jasper installation package.

If someone is looking for the answer to j2ee-jasper integration, that webapp sample directory's path is jasperreports-1.2.3\demo\samples\webapp.

Ranjith (
Richard Walton

Joined: Jul 01, 2002
Posts: 10
Yip its a very cool demo but if you want somethign better let me know i have some code.
Also have a look at BIRT. ( Eclipse project)

<a href="" target="_blank" rel="nofollow"></a><br />Change - When the winds of change blow hard enough, the most trivial things can turn into deadly projectiles.
I agree. Here's the link:
subject: Jasper usage in J2EE
jQuery in Action, 3rd edition