Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
!!!ODA Data Source Binding to BIRT Report
(:table cellspacing='0' cellpadding='0' border='0' width='98%':) (:cell style='background-color: #e0e0e0; padding: 10px;':) This project aims to provide an easy way to bind ODA data source properties to report parameters and other runtime data.
!!History Proposed November 3, 2005
Implementation Complete Dec 20, 2005
!!Specification Lead Gary Xue
!!Expert Group Linda Chan, Wenbin He, Stanley Wang (:tableend:)
!Description An ODA Data Source defines a list of data source properties (“connection properties”) for which values must be furnished at runtime to establish a connection. In a common usage scenario, the values for these connection properties are not known at report design time. Rather their values are calculated at runtime based on user input or environment settings etc. In BIRT 1.x, runtime assignment of data source connection properties can be done only through scripting. There are two problems with this approach. Firstly it requires the report designer to write script code. Secondly the custom scripts are associated with the data source design. This makes it difficult to share the same data source design across multiple reports, since each report design may have its own logic for providing runtime values for these properties.
- if a data source binding is defined in the report for that data source, and the binding associates the connection property with an expression, the expression is evaluated and its result used as the initial value for that property.
- Otherwise, the value of that property as defined in the data source design is used as the initial value.
- The beforeOpen script of the data source, if present, is evaluated, which can further modify the connection property value set in (1) or (2).
!!Example As an example, the out-of-the-box ODA-JDBC driver defines the following 4 static connection properties: odaDriverClass, odaURL, odaUser and odaPassword. Suppose the report would allow the user to specify the database, user and password for a JDBC data source when running the report. The report designer will define 3 named report parameters:
||border=1 width=50% ||!Parameter Name||!Data Type||!Description|| ||p_db ||String ||name of database to connect to || ||p_user ||String ||DB user name || ||p_password ||String||DB password ||
The report designer can then use report designer to define a Data Source Binding for the JDBC data source:
||border=1 width=70% ||!Connection Property||!Binding Expression|| ||odaURL ||"jdbc:my_driver:my_server;database=" + params["p_db"] || ||odaUser ||params["p_user"] || ||odaPassword ||params["p_password"] ||
Note that since no binding is created for property odaDriverClass, the value specified in the data source design for that property is used.
- Provide Model API to allow definition of and access to Data Source Bindings.
- Provide UI for defining data source binding in BIRT Report Designer.
!!Specification Document(s) [| Functional Specification (Version 1 - Dec 21, 2005)]
!!Related Bugzilla Entries [| 109409]