icccapital Posted February 17, 2011 Share Posted February 17, 2011 I am at a total loss. I have gotten this to work before, but everything I have done I can't seem to get the attributes to display in the report query in Ireport. My code is below for the factory class. I have jarred the three classes in one jar file. I have added the jar file to the classpath in ireport and I have created a new connection/datasource with the following informationJavaBeans set datasourcename: MailersFactoryClass: beanCollect.BeanCollectionchecked Collection of JavaBeansmethod: createBeanCollectionCan anyone give me something else to try, thanksCode:/* * To change this template, choose Tools | Templates * and open the template in the editor. */package beanCollect;import java.util.ArrayList;import java.util.List;import org.myapp.model.Contacts;import org.myapp.model.Clients;public class BeanCollection { public static List createBeanCollection(){ List<Clients> myList = new ArrayList<Clients>(); Contacts co = new Contacts(); Clients cl = new Clients(); co.setiD1(new Long(10)); co.setCompany("Company"); co.setFirstName("Bill"); co.setLastName("Lung"); co.setAddress("10 place"); co.setAddress2("Address 2"); co.setCity("Orlando"); co.setState("FL"); co.setZipCode("32801"); List<Contacts> lc = new ArrayList<Contacts>(); cl.setPosition("Doctor"); lc.add(co); cl.setContacts(lc); myList.add(cl); return myList; }} Link to comment Share on other sites More sharing options...
icccapital Posted March 8, 2011 Author Share Posted March 8, 2011 I stepped away from the project for a bit and so just came back and figured out what I was doing wrong. For those who need this info, I figured out that you have to have the createBeanCollection (aggregator of the list of objects) method in the bean that has all of the attributes. Maybe in future versions this won't be a limitation. 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