Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
dynamic data source
digo
Hi,
I am having trouble selecting a data source dynamically in birt 2.5.1. Here is what I have:
1. a report parameter, rp_dbname of type String, that is to be picked from a list
2. in Edit Data Source window->BIRT JDBC Data Source tab->Driver URL field:
jdbc:mysql://localhost/montreal
3. a script in the Edit Data Source window->Property Binding tab->JDBC Driver URL field:
if(params["rp_dbname"].value=="montreal") {
"jdbc:mysql://localhost/montreal";}
else{
"jdbc:mysql://localhost/quebec";
}
to connect to either database montreal or quebec. The databases have identical schema but contain different data, obviously.
When I generate the report, no matter which database I select, the data is from whatever is in Edit Data Source window->BIRT JDBC Data Source tab (montreal in this case)
Is something missing? Do I have to set something else?
Thanks,
digo
Find more posts tagged with
Comments
Ashwind
I am trying with birt 2.5.1 and its working fine.
I am attaching a sample of mine.
digo
Your sample is of a later version. I downloaded that one and it works now.
I am surprised that I found no mention of it from anyone that dynamic data source didn't work in 2.5.1. I haven't changed anything and it works in 2.5.2. so I am pretty sure it is a bug with version 2.5.1.
Thanks again.