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 Dynamic  jasperReport  on Single jsp 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 "Dynamic  jasperReport  on Single jsp" Watch "Dynamic  jasperReport  on Single jsp" New topic

Dynamic jasperReport on Single jsp

NazneenAliza Shaikh

Joined: Jan 17, 2008
Posts: 10
Hello experts
I am working on jasper reports to generaete reports and also i have downloaded ireports latest version for working with jasper reports and creating reports .. its all working fine ... but now my requirement currently is something different

1. User will have a page where he would input the parameters like From Date - To Date and will select one another parameter

2. Depending on the parameter the search would be executed on the db and all the records matching the same criterial are required to be shown would be saved into the array list or what ever..

3. Now a report shall be generated for the same.. means a pdf, .html will be generated and given to the Jsp..

4.Only 1 jsp is responsible for taking parameters from jsp and displaying back the Jasper report depending upon the parameters form jsp(FromDate toDate,onemore parameter).

The Problem is i am succesfully generating Dynamic jasper but unable to display it on same jsp(By using <Iframe> tag m succesfully displaying report but that is static i mean whenever i m passing another parameters the report is getting generated but not viewable to same jsp)

pliz give me code
Gayathri Chowduru
Ranch Hand

Joined: Oct 17, 2007
Posts: 42

The IFRAME tag in HTML willbe used to create an inline frame that contains another document.

In your question you said like after inputting the data, you will search the data base looking for the criteria that is matching with your data.

Do you want to display the database results in a jsp?

If so, you can use for loop for the ArrayList.size() times and you can display...

If not, please post your question in detail...

Rakesh Vinnakota

Joined: Jul 14, 2008
Posts: 1
Hi ,
option 1:
after entering the inputs,provide two hyperlinks
1. To view the pdf file
2. to view the html file
When the user clicks on the hyperlink then open the pdf/html page in new window using the servlet.

option 2:
Along with the inputs , ask user to select which format the user needs to view the report
open the generated report in a new window using the servlet.

As the report code is same for html/pdf/Excel, you wont need to create another jsp.
Please take care that servlet is opening the generated report for every request.
May be this solves your problem.
Thanks and regards,
Rakesh Vinnakota
I agree. Here's the link:
subject: Dynamic jasperReport on Single jsp
It's not a secret anymore!