Win a copy of OCP Oracle Certified Professional Java SE 11 Developer Practice Tests this week in the OCP forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
  • paul wheaton
  • Mark Herschberg
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Frits Walraven
  • Jj Roberts
  • Carey Brown
  • salvin francis
  • Piet Souris

Dynamic jasperReport on Single jsp

Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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

Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
I RELEASE YOU! (for now .... ) Feel free to peruse this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic