Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Dynamic jasperReport on Single jsp

 
NazneenAliza Shaikh
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

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

Thanks,
Gayathri.
 
Rakesh Vinnakota
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic