1
votes

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

new JRBeanCollectionDataSource($F{actions})

which is found on many docs.

When I compile I get:

JRBeanCollectionDataSource cannot be resolved to a type

I don't get it, it's a JasperReports class... how can it be missing. I even controlled the settings and the Jar with the class is in the classpath.

What could be the reason?

2
What type have this field (actions)? What happened if you are compiling reports (master and subreport) with help of iReport?Alex K

2 Answers

3
votes

Use data source as in jrxml.

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

[SOLVED]here i have a similar situation, for the subreports at main report, that kind of conection works fine, but when i use the same "Data Source Expression" for the subreport of any subreport, i got that error:

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

You haven't got any solution yet?

main
  |----subreport (ok)
  |               |---subreport (error)
  |
  |----subreport (ok)