Jump to content

Cannot find attribute in the Java bean data source


lucky7456969

Recommended Posts

I don't know why Here is the factory class

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package jewellery.Charting;

/**
 *
 * @author Jacky
 */
public class AgeDistribution {
    
    int ProductID;
    String ProductName;
    String AgeGroup;
    int NoOfPeople;
    
    public AgeDistribution()
    {
        
    }

    public AgeDistribution(int ProductID, String ProductName, String AgeGroup, int NoOfPeople) {
        this.ProductID = ProductID;
        this.ProductName = ProductName;
        this.AgeGroup = AgeGroup;
        this.NoOfPeople = NoOfPeople;
    }
    

    public int getProductID() {
        return ProductID;
    }

    public void setProductID(int ProductID) {
        this.ProductID = ProductID;
    }

    public String getProductName() {
        return ProductName;
    }

    public void setProductName(String ProductName) {
        this.ProductName = ProductName;
    }

    public String getAgeGroup() {
        return AgeGroup;
    }

    public void setAgeGroup(String AgeGroup) {
        this.AgeGroup = AgeGroup;
    }

    public int getNoOfPeople() {
        return NoOfPeople;
    }

    public void setNoOfPeople(int NoOfPeople) {
        this.NoOfPeople = NoOfPeople;
    }
    
    

    
    
}
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Reporting.BeanDataSource;

import java.util.ArrayList;
import java.util.List;
import jewellery.Charting.AgeDistribution;

/**
 *
 * @author Jacky
 */
public class AgeDistributionFactory {
 
  public static java.util.Collection generateCollection()
  {
    java.util.Vector collection = new java.util.Vector();
    assert (!lAgeDistribution.isEmpty());
    for (AgeDistribution ageDist : lAgeDistribution)
    {
        collection.add(ageDist);
    }
    return collection;
   }
 
  public static void addToCollection(AgeDistribution ageDist)
  {
      lAgeDistribution.add(ageDist);
  }
 
  static List<AgeDistribution> lAgeDistribution = new ArrayList<>();
}
 


net.sf.jasperreports.engine.JRException: Error retrieving field value from bean : ProductID

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Days

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