File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes configuring jasper reports with struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "configuring jasper reports with struts" Watch "configuring jasper reports with struts" New topic

configuring jasper reports with struts

Jim Colwood

Joined: Jul 10, 2007
Posts: 10
Hi All,

I am trying to add a reporting module in my existing web app. I am using Struts & IBatis frameworks in my app.

This is waht I have so far...
In my Actin class...
1. I compile .jrxml & get jasperReport object.
2. create dataSource object by passing a List in JRBeanCollectionDataSource() constructor.
3. get JasperPrint object by calling JasperFillManager.fillReport(jasperReport, parameters, dataSource)
4. create exporter object from JRHtmlExporter class & call exporter.exportReport().
5. forawrd control to the display jsp to display the report.

The problem is...
It doesn't forward to the JSP I specified in struts-config.xml. I think exportReport() method take control & process the request w/o giving control back to struts. I also tried doing all of the above on my display JSP & just forwarding request to this JSP from my action class, but of no use.

Is there an easier way of configuring Jasper Reports with struts? I would appreciate any help.

SCJP 6 |
I agree. Here's the link:
subject: configuring jasper reports with struts
It's not a secret anymore!