icccapital Posted January 11, 2011 Share Posted January 11, 2011 My setup is that I have a bean that I want to fill my report with. The code below is how I try to run my report where cc is an instance of the ClientCode bean. I am getting an error "Error retrieving field value from bean: ClientCode". Is there a way to get more information than this or is there something obvious that I am doing wrong. Please let me know if there is more information needed. Thanks in advance for the help.Code:List<ClientCode> dl = new ArrayList<ClientCode>(); dl.add(cc); JasperPrint jp = JasperFillManager.fillReport("c:\\documents and settings\\upjohs.ICCCAP\\My Documents\\NetbeansProjects\\MyBatis\\src\\report1.jasper", m, new JRBeanCollectionDataSource(dl)); JasperViewer.viewReport(jp); Link to comment Share on other sites More sharing options...
ceday Posted January 12, 2011 Share Posted January 12, 2011 afaik, fields must be case-sensitive, since it uses reflection to get field values.check that one. Link to comment Share on other sites More sharing options...
icccapital Posted January 12, 2011 Author Share Posted January 12, 2011 Thanks for the reply. I think I have figured out the issue, but please tell me if I am wrong. I have two java beans one bean contains a list of the other bean to try to mirror a one to many relationship of the data. I was trying to pass this bean in the collection to jasper. It seems that Jasper won't look for fields within the list of the second bean, is that correct?I have been reading to try to find a solution to my problem other than just writing the query in the report. If anyone knows how to solve for this either by creating a collection that contains both beans or anything it would be helpful.Thanks to all for the thoughts. example code is belowCode:public class Client{ private List<Addresses> a; public getA();....}public class Addresses{ get/set....} 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