属性文件中的Birt数据源参数 [英] Birt data source parameters from a property file

查看:74
本文介绍了属性文件中的Birt数据源参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有多个BIRT报告,它们从同一jdbc数据源获取数据.

I have multiple BIRT reports that obtains the data from the same jdbc data source.

是否可以从外部属性文件或类似文件中获取连接参数(驱动程序URL,用户名和密码)?

Is it possible to obtain the conection parameters (Driver URL, User Name, and Password) from an external property file or similar?

推荐答案

创建功能性数据源后,可以将该数据源添加到报表库中,该报表库可以由系统中的所有BIRT报表导入和使用.库中的源可以具有静态连接属性,也可以使用外部属性来抽象它们.

One you create a functional data source, you can add that data source to a report library that can be imported and used by all BIRT reports in your system. The source inside the library can have static connection attributes, or you can abstract them using externalized properties.

如果要外部化连接信息,则需要调整数据源本身.在数据源编辑器内部,有一个属性绑定"部分,可让您抽象化控制数据连接的所有值.在这里,您可以将值(使用表达式编辑器)绑定到报表参数或属性文件.

If you want to externalize the connection info, you will need to tweak the Data source itself. Inside the Data Source Editor, there is a "Property Binding" section that allows you to abstract all the values governing the data connection. From there you can bind the values (using the expression editor) to either report parameters or a properties file.

要绑定到报表参数,请使用以下语法:params[parametername].value作为表达式.

To bind to a report parameter, use this syntax: params[parametername].value as the expression.

要绑定到属性文件,请在报表的顶级属性中设置资源文件.从那里,您可以仅使用属性键值将条目绑定到数据源.

To bind to a properties file, set the Resource file in the Report's top-level properties. From there you can just use the property key value to bind the entry to the Data Source.

祝你好运!

这篇关于属性文件中的Birt数据源参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆