Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes forum!
    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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

Dynamic Jasper Report on jsp

Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ".html" will be generated and given to the same jsp..

4.Only one jsp is responsible for taking the parameters and displaying the Reports...

5.I am perfectly generating the jasper reports depending upon the parameters from jsp(user)...but the problem is how to display that dynamically...(Using Iframe i am getting report but that is static not dynamic)...
Pliz help me out
give me code
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
divide your jsp on two independent parts, depending form parameter.

For example introduce parameter "showReport" = pass it by POST or GET. For instance if your one *.jsp page is report.jsp - to see form, use http://.../report.jsp?showReport=false, to see the result - use http://.../report.jsp?showReport=true.

Then this parameter can be considered to separate form rendering from results rendering. Use JSTL tags or easy scriplets to control the flow of jsp execution.

Use redirect or forward directive to output result from jasper.

The described solution does not imply any iframes. With frames - it is easier. Create two jsp pages first (one for form and one for result). show them in separate iframes of one html document. Use javascript to build url and point this url to access the result page, refresh it if there is a signal form form.
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Duplicate of:
Popeye has his spinach. I have this tiny ad:
Garden Master Course kickstarter
    Bookmark Topic Watch Topic
  • New Topic