Jump to content
We've recently updated our Privacy Statement, available here ×

Pass bean to subreport


crusty_collins

Recommended Posts

I have been working on this for some time and have never seen anyone post how to do it.  This morning the light bulb went on.

I wrote a small app to parse a mal formed xml document and pass the results as a collection to ireports.

I was very happy to get it working and several posts in this forum helped me accomplish this.

 

 

So now I wanted to use this data in a much larger report.  

Here is how I did it.

Create a subreport using your current datasource settings.

Create a new Parameter called MyDataSource

set the class type to

net.sf.jasperreports.engine.data.JRAbstractBeanDataSource

Set the default value expression to your bean info

new JRBeanCollectionDataSource(com.chris.jasper.xmlFactory.getURL())

Open the properties of the sub report. 

Select the subreport tab.

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...