Jump to content

problem passing data from master report to Subreport


luulamuse

Recommended Posts

 

Hi,

I received a collections of animals in my master report. I added 2 subreports into the master reports.

The first subreport should display only dogs informations and the second subreport should display only cats informations by following the order of the main collections.

I tried 3 differents attempts to get the expected results but none of them have worked!!

1) first attempt

To pass data to each subreport, I did this:

connection type = use a data source expression

data source expression = ((net.sf.jasperreports.engine.data.JRBeanCollectionDataSource)$P{REPORT_DATA_SOURCE}).cloneDataSource()

I created parameters to display details.

In each subreport, all animals are displayed animals (cats and dogs) which is bad.

2) second attempt

To pass data to each subreport, I did this:

connection type = use a data source expression

data source expression = $P{REPORT_DATA_SOURCE})

In each subreport, only the first animal is displayed. Any iteration is done.

Could you please help me. I am new in Jasper report and I don't know how to pass data from master to subreport one element at time.

Thanks a lot.

Link to comment
Share on other sites

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

  • 2 years later...

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