Unable to retrieve value from a JavaBean while generating reports using JasperReports API

The solution is very simple – you should change the access modifier of JavaBean class to public.

Like this:

public class EventBean {
    private String name;
    private String count;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCount() {
        return count;
    }

    public void setCount(String count) {
        this.count = count;
    }
}

Don’t forget that you are using your own package.


You can find more information about JavaBean Data Sources here

Leave a Comment