Jump to content

How to pass diff datasource 1 by 1 to subreport


bobz28

Recommended Posts

Hi,

Can someone help show me how to pass diff datasource to subreport. I am having a problem where I want to pass an array of DataSource to master report. How can I pass datsource one by one from master report to the subreport.

i.e: subds[0], subds[1]...subds[n]...

Thanks---

Here is what I have in the controller code:

============================

HibernateQueryResultDataSource ds = (master datasource)

HibernateQueryResultDataSource subds = new HibernateQueryResultDataSource[input.size()];

for (int i=0; i < input.size(); i++){

  List<?> reportQuery = getReport(input.get(i));

  String[] fields = new String[] {"a", "b", "c"};

  subds = new HibernateQueryResultDataSource(reportQuery, fields);

}

model.put("dataSource", ds);

model.put("subDataSource", subds);

return model;

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Days

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