How to set a datasource for a BIRT report programmatically?

后端 未结 5 984
借酒劲吻你
借酒劲吻你 2021-02-04 08:46

I have a BIRT report which connects to our test database. In the productive environment I would like to supply a datasource which is provided by the container through jndi.

5条回答
  •  滥情空心
    2021-02-04 09:12

    Setting just the data source at run-time will be problematic because the data set is bound to a single data source and your controls on the report are then bound to a specific data set. This hierarchy would be pretty sticky to try and build yourself each time the report runs.

    You can parameterize all aspects of the Data Source definition making your design portable through all environments. When editing your Data Source, look at the Property Binding grouping on the left hand side. This should give you ample flexibility to make your data source more portable. You can specify run-time parameters for JDBC URL elements or a run-time JNDI profile.

    Hope this helps.

提交回复
热议问题