bobz28 Posted September 8, 2010 Share Posted September 8, 2010 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now