Home
Analytics
Setting the DataSource
cwfranklin
Hi all,
I did a search on this subject here on the forums, but I didn't find anything that matched my situation. I'm hoping someone here can help me.
We have Birt integrated with a Enterprise app. I have a few datasources set up in the Birt Report Designer. For development we were using one datasource, for QA we are using another data, and in the future for production we will be using a different datasource. All of which are configured in the report designer. Currently, I have about 5 report designs and everytime I need to make a build for a certain environment I have to change the datasource for each reports individually. What I want to be able to do is read the datasource name from a properties file from my java app and set the datasource accordingly.
can this be done, and if so how? Any help would be greatly appreciated.
Thanks
Find more posts tagged with
Comments
mwilliams
Hi cwfranklin,
So, you're using a completely different set of data? Or are you just limiting the data in a different way? Also, what type of dataSource are you using?
DFN
Hi mwilliams,
I have similar situation described by cwfranklin.
Currently my datasources are xml-based OdaDataSource.
The report datasets do not change, data structure also do not change, but the actual data varies (it comes from different xml files).
I would like to be able to change the report's DataSource on the fly at runtime depending on user choice of xml file.
thanks
DFN
ok, i found an answer in <br />
<a class='bbc_url' href='
http://dev.eclipse.org/newslists/news.eclipse.birt/msg16271.html'>[news.eclipse.birt]
Re: Creating and using xml data sources / sets progr</a>
mwilliams
This idea can also be seen here:<br />
<br />
<a class='bbc_url' href='
http://www.birt-exchange.org/devshare/designing-birt-reports/562-birt-swap-xml-data-source/#description'>BIRT
: Swap XML Data Source - Designs & Code - BIRT Exchange</a><br />
<br />
If you have a dataSource that is a flat file that you need to switch, this should help:<br />
<br />
<a class='bbc_url' href='
http://www.birt-exchange.org/devshare/designing-birt-reports/949-switch-text-datasource-at-runtime/#description'>Switch
Text DataSource at runtime - Designs & Code - BIRT Exchange</a>
menegazzo
Just create one rptlibrary with specific datasources for each environment.
It will act as a property file. Simpler, faster, no code.
vshah
I can I do that if I am using JDBC connection to oull data from SQL Server 2005.
I tried clearing the Driver URL, which is currently " jdbc:sqlserver://dbcluster:1433;DatabaseName=hist "
and using " jdbc:sqlserver://dbcluster:1433;DatabaseName=+params["indexName"].value " in the JDBC Driver URL under the property binding tab