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

后端 未结 2 1491
北海茫月
北海茫月 2020-11-27 23:32

I am trying to generate a simple JR report from a list.

I am keep getting Error retrieving field value from bean : name

This error

相关标签:
2条回答
  • 2020-11-28 00:13

    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

    0 讨论(0)
  • 2020-11-28 00:29

    the Bean attribute should be started with Small letter

    example :

    public class DataBean {
         private String name;
         private String dateStart;
         private String DateEnd; //  ->dateEnd
         private String prixTotale;
         private String prixPayer;
    
    0 讨论(0)
提交回复
热议问题