Jasper reposts无法编译包含JRBeanCollectionDataSource的表达式,为什么? [英] Jasper reposts can't compile an expression that contains JRBeanCollectionDataSource, why?
本文介绍了Jasper reposts无法编译包含JRBeanCollectionDataSource的表达式,为什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在创建一个包含ireport子报表的报表。两者的数据源都是java bean。问题是,当我为子报表创建数据源表达式时,我将使用:
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.
编译时我得到:
JRBeanCollectionDataSource cannot be resolved to a type
我不明白,它是一个JasperReports类......它怎么会丢失。我甚至控制了
设置,而且类的Jar在类路径中。
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.
可能是什么原因?
推荐答案
使用jrxml中的数据源。
Use data source as in jrxml.
<dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{actions})]]></dataSourceExpression>
这篇关于Jasper reposts无法编译包含JRBeanCollectionDataSource的表达式,为什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文