Jasper reposts cannot compile an expression containing a JRBeanCollectionDataSource, why?

I am creating a subreport report with ireport. The data source for both is java beans. The problem is that when I create a data source expression for a subreport, I will use:

new JRBeanCollectionDataSource($F{actions}) 

which is contained in many documents.

When I compile, I get:

 JRBeanCollectionDataSource cannot be resolved to a type 

I do not understand, this is the JasperReports class ... how it might be missing. I even controlled and Jar with the class is on the way to classes.

What could be the reason?

+1
source share
2 answers

Use the data source as in jrxml.

 <dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{actions})]]></dataSourceExpression> 
+3
source

[SOLVED] I have a similar situation here, for subscriptions in the main report this kind of work works fine, but when I use the same "data source expression" to sub-report any subheading, I got this error:

JRBeanCollectionDataSource cannot be resolved for a value of type = (net.sf.jasperreports.engine.JRDataSource) (new JRBeanCollectionDataSource (((java.util.List) field_graficoXY.getValue ()))); // $ JR_EXPR_ID = $ 135

Don't have a solution yet?

main
| ---- Games and Consoles | | --- subreport (error)
|
| ---- Games and Consoles

+2
source

Source: https://habr.com/ru/post/1435597/


All Articles