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

net.sf.jasperreports.engine.data.JRBeanCollectionDataSource cannot be cast to java.lang.Boolean error


amitchechare

Recommended Posts

I am getting an exception( Exception in thread "main" java.lang.ClassCastException: net.sf.jasperreports.engine.data.JRBeanCollectionDataSource cannot be cast to java.lang.Boolean )  while creating a report(Bar Grap) in iReport. I am passing JRBeanCollectionDataSource object through map as follow.

1st I have created POJO class then created object of that POJO class inserted them in a list. Then created JRBeanCollectionDataSource from that list as follow

JRBeanCollectionDataSource chartDataSource = new JRBeanCollectionDataSource(list);

and passing that parameter through hashmap 

HashMap<String, Object> parameters = new HashMap<String, Object>(); 

 parameters.put("chartDataSource", chartDataSource); 

In iReports I have created parameter with name="chartDataSource" and type="net.sf.jasperreports.engine.data.JRBeanCollectionDataSource" created fields as created in  the POJO (All fields are of String type).

But while generating Graph in iReport getting exception "Exception in thread "main" java.lang.ClassCastException: net.sf.jasperreports.engine.data.JRBeanCollectionDataSource cannot be cast to java.lang.Boolean "

Please help.

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