Jump to content

Complications with subreport.


phnxck

Recommended Posts

Hi,

I would like to create main report, that will have subreport in his detail band. I want this subreport to be repeated as many times as I have elements in data source of the main report. Moreover I would like this subreport to display different values. It consists of some parameters and dynamic list components.

The question is, how to create this whole data flow. I mean I would have in main report data source as a collection of Java Beans. Each bean should reporesent data source per each sub report (single parameters as well as lists). How should I inject in each subreport data that comes from one of the main report data source Java Bean collection?

Thanks.

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

You set how to provide the data to the subreport (read: you set the data source to be passed to the subreport) in the subreport element, in the property Data Source Expression, which in your case will be something like:

$F{hobbiesDs}

Assuming your bean has a method called getHobbiesDs which returns a JRDataSource and that you registered this method as field in the main report dataset.

Giulio

Link to comment
Share on other sites

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