ireport系统参数

来源:互联网 发布:java 停车场计费系统 编辑:程序博客网 时间:2024/06/17 14:54

1.subreport_dir:用于指定当前.jrxml的所处位置为绝对路径:subreport_dir:d:/ireport/stuirepot

可在程序中通过传入参数给JasperFillManager.fillReport(jasperReport, parameter,   conn);指定当前要解析的文件的绝对路径paramete.put("SUBREPORT_DIR","D:/ireport/stuireport")

2.$P{REPORT_CONNECTION}为当前的connection的对象

 

http://hi.baidu.com/icefree/blog/item/a23ae2edc6228c4b79f05568.html

 

ireport中提供了自带属性$P{SUBREPORT_DIR}当我们新建.jrxml文件时默认$P{SUBREPORT_DIR}="存放当前设计的.jrxml文件的文件夹绝对路径"

此时需注意应把$P{SUBREPORT_DIR}值设置为$P{SUBREPORT_DIR}="",这表示获得当前运行环境的.jrxml文件的上级文件绝对路径

如果不进行此设置则部署到运行环境时会以设计时的路径加载.jrxml文件,会报Could not load object from location:.jrxml错误

另外如果设计时用到多级子报表,则应当把顶级报表的$P{SUBREPORT_DIR}参数传给子报表,如果不进行此操作则第三级.jrxml文件不能被加载

Could not load object from location:.jrxml

原创粉丝点击