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)
set data source via parameter
chavez_ant
I've got reports in development, set up such that they'd all be compatible with multiple data sources.
In BIRT Designer, I set the connection by going to 'Data Source Explorer' then adding the connections under 'JDBC Data Source'. Let's say I have 3 connections listed named datasource1, datasource2, datasource3.
The Data Source in the report is created from a connection profile in the profile store. To change databases, When in the designer, I simply edit the data source, then click 'connection profile', then select the database I want the report to connect to from there, one of the 3 listed above.
My question is, with this setup, can I create a hidden parameter, that will pass in the data source name or another value, and based on that value, the report will run across datasource1, datasource2, datasource3 - whichever is passed in. Any details on this or script examples would also be great.
Thanks in advance!!
-A.C.
Find more posts tagged with
Comments
chavez_ant
I was able to figure this out. I think writing up this issue and posting helped me think it through and find an easy solution.
With the above setup, all I had to do was create a parameter named DBString and give it a default value datasource1, and set it to hidden. Then I edit the data source and go to the 'property binding' section. Set the 'Connection Profile Name' to point to the parameter: params["DBString"].value
Now the application will be able to plug the Connection Profile Name into the parameter, and have the report use the correct database connection based on it!