Asdfghjkl123 Posted June 27, 2008 Share Posted June 27, 2008 I have problem to display a subreport in a master report. Data sources for both are collections. When I put a subreport element into a master report it's need to define "Connection/data source expression". So I wrote in a text field "new JREmptyDataSource(1)". After this in a pdf appears a null information from a subreport. Please could you help me to write the data source expression?Subreport data source class looks liki this:Code:public class ServiceBean { private String name; public static List createBeanCollection() { List list = new ArrayList(); ServiceBean serviceBean = new ServiceBean(); serviceBean.setName("name1"«»); list.add(serviceBean); ServiceBean serviceBean1 = new ServiceBean(); serviceBean1.setName("name2"«»); list.add(serviceBean1); return list; } public String getName() { return name; } public void setName(final String name) { this.name = name; }}Thanks in advance.Regards, Denis. Link to comment Share on other sites More sharing options...
nasir.qureshi Posted July 16, 2008 Share Posted July 16, 2008 i am facing the same problem please let me know if u have a solution Link to comment Share on other sites More sharing options...
lshannon Posted July 16, 2008 Share Posted July 16, 2008 Try something like this. Datasource Expression: new JRBeanCollectionDataSource(ServiceBean.createBeanCollection()) Hope this helps. Link to comment Share on other sites More sharing options...
Scott Andersen Posted June 14, 2022 Share Posted June 14, 2022 Here is a WIKI article that may help:https://community.jaspersoft.com/wiki/jaspersoft-report-using-two-separate-data-sources 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