开发者

Setting the JRQueryExecuter property in java together with a JasperDesign object

I have some code that will read a jrxml file 开发者_StackOverflow中文版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


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜