JasperReports and Web Application

I'm able to get the web application demo to run just fine. However, that demo just uses a single report. I need to have a main report and a sub-report in my web application.

But when I add a sub-report to the main report that uses an new JRBeanCollectionDataSource as the datasource expression I get an error:

javax.servlet.ServletException: javax.servlet.ServletException: Error evaluating expression : Source text : new JRBeanCollectionDataSource($F{phones})

The JasperReport main and sub-report works fine in iReport. They also work fine in just a plain java application.

Any help would be greatly appreciated on how to use a sub-report with a main report in a web application.
Post edited by: phillips1021, at: 2008/07/12 22:58
phillips1021's picture
Joined: Jul 6 2008 - 6:59am
Last seen: 15 years 2 months ago

1 Answer:

Thanks to some great help from Dave Newton, I was able to figure out how to use Struts2, JasperReports, a main report and a sub-report in my web application.

I blogged about how I got it all to work here:

http://tinyurl.com/5h7nvv


on my blog at http://www.brucephillips.name/blog
.

In that blog entry you can download a complete war file with source code including the .jrxml files.

Bruce
phillips1021's picture
Joined: Jul 6 2008 - 6:59am
Last seen: 15 years 2 months ago
Feedback
randomness