Change sql depending on type of the database [message #1449546] |
Tue, 21 October 2014 14:06 |
Alena Bugarová Messages: 3 Registered: August 2013 |
Junior Member |
|
|
I need to change the query text of datasource depending on the type of the connected database, before that the query get executed by the birt runtime.
We have data source on Oracle or Informix database for one report, These databases don't have the same query in some cases.
We use data source from Connection Profile, Birt runtime priew (4.3.)
I tested beforeOpen script of the dataset, but variable con is empty.
I also used this.getDataSource().getExtensionProperty("odaDriverClass"), but this value
showed information from design time and it was not updated in run time.
Can you help me?
beforeOpen script:
var con = reportContext.getAppContext().get("OdaJDBCDriverPassInConnection");
if(con != null) {
var driverclass = con.getMetaData().getURL();
if(driverclass.indexOf("informix") > 0) {
this.queryText = "select Informix..";
else this.queryText = "select Oracle...";
}
|
|
|
Powered by
FUDForum. Page generated in 0.02544 seconds