在 java 中与 JasperDesign 对象一起设置 JRQueryExecuter 属性
我有一些代码可以将 jrxml 文件读入 JasperDesign 对象。
design.setProperty(JRQueryExecuterFactory.QUERY_EXECUTER_FACTORY_PREFIX + "CXS_SQL", "net.sf.jasperreports.engine.query.JRConnexysJdbcQueryExecuterFactory");
try {
in = new FileInputStream(URI);
design = JRXmlLoader.load(in);
in.close();
} catch (Exception ex) {
ex.printStackTrace();
}
我正在尝试设置 JasperDesign 对象的 QueryExecuter 属性,但它似乎不起作用。有人知道我在这里做错了什么吗?
问候, 彼得
I have some code that will read a jrxml file into a JasperDesign object.
design.setProperty(JRQueryExecuterFactory.QUERY_EXECUTER_FACTORY_PREFIX + "CXS_SQL", "net.sf.jasperreports.engine.query.JRConnexysJdbcQueryExecuterFactory");
try {
in = new FileInputStream(URI);
design = JRXmlLoader.load(in);
in.close();
} catch (Exception ex) {
ex.printStackTrace();
}
I'm trying to set the QueryExecuter property for the JasperDesign object, but it doesn't seem to work. Anybody any clues on to what i'm doing wrong here ?
Regards,
Peter
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我想通了(在阅读文档时完全错过了那部分,抱歉)。我知道调用 JRProperties.setProperty(JRQueryExecuterFactory.QUERY_EXECUTER_FACTORY_PREFIX + "CXS_SQL", "net.sf.jasperreports.engine.query.JRConnexysJdbcQueryExecuterFactory");在我加载设计之前,现在它可以工作了。
问候,彼得
I figured it out (totally missed that part while reading the documentation, sorry). I know call a JRProperties.setProperty(JRQueryExecuterFactory.QUERY_EXECUTER_FACTORY_PREFIX + "CXS_SQL", "net.sf.jasperreports.engine.query.JRConnexysJdbcQueryExecuterFactory"); Before i load the design, and now it works.
Regards, Peter