Jump to content
We've recently updated our Privacy Statement, available here ×

JRBeanCollectionDataSource Error retrieving field value from bean


icccapital

Recommended Posts

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

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

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 below

Code:
public class Client{   private List<Addresses> a;    public getA();....}public class Addresses{   get/set....}
Link to comment
Share on other sites

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