sinsand Posted February 21, 2014 Share Posted February 21, 2014 hi below is the error, i am getting wne i am trying to pass a datasource to jasper from groovyCannot cast object 'net.sf.jasperreports.engine.data.JRMapCollectionDataSource@9fa028' with class 'java.lang.String' to class 'net.sf.jasperreports.engine.data.JRMapCollectionDataSource'.My groovy code isList ls = new ArrayList(); Map mp = new HashMap(); mp.put("aa","a"); mp.put("bb","xx"); mp.put("cc",20.0); mp.put("dd",2.0); mp.put("ee",1.5); ls.add(mp);params.putAt("subReportData",new JRMapCollectionDataSource(ls))My Main report.jrxmlI am having it as a parameter<parameter name="subReportData" class="net.sf.jasperreports.engine.data.JRMapCollectionDataSource">and passing this as a dataSourceExpression to the subreportCan any one suggests whats wrong?i have done this with java and that was working fine. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now