JasperReports:实例化 JRDesignChartDatasets
我正在尝试实例化一个 JRDesignChartDataset 对象,以便可以将其传递给 JRDesignPieDataset 实例的构造函数,如下所示:
JRDesignPieDataset pieDataset = new JRDesignPieDataset(new JRDesignChartDataset());
这会在 Eclipse 中产生编译器错误,抱怨它无法实例化 JRDesignChartDataset 类型...?!?!
我已确保已从正确的包中导入它:
import net.sf.jasperreports.engine.design.JRDesignChartDataset;
并且我已检查了当前的(4.1.3)Javadocs 表明这是一个具有公共无参数构造函数的具体类...
我认为的所有其他 JR 类型我从 net.sf.jasperreports.engine.design
包导入时表现得非常好...我在这里缺少什么?
提前致谢!
I am trying to instantiate a JRDesignChartDataset
object so that I can pass it in to the constructor of a JRDesignPieDataset
instance like so:
JRDesignPieDataset pieDataset = new JRDesignPieDataset(new JRDesignChartDataset());
This produces a compiler error in Eclipse, complaining that it Cannot instantiate the type JRDesignChartDataset...?!?!
I've made sure that I've imported it from the correct package:
import net.sf.jasperreports.engine.design.JRDesignChartDataset;
And I've checked the current (4.1.3) Javadocs which show this is as a concrete class with a public no-args constructor...
All of the otther JR types that I am importing from the net.sf.jasperreports.engine.design
package are behaving perfectly fine...what am I missing here?
Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这可能不是推荐的做法,但我继承了一些仅将
null
传递到构造函数中的代码。不确定它有什么影响(如果有的话),但它似乎完成了工作。This may not be the recommended practice, but I've inherited some code that simply passes
null
into the constructor. Not sure what effect it has (if any), but it seems to get the job done.