Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Changing DataSets at runtime
ccioriia
Hi guys,
I have created several reports using BIRT Report Designer 2.5 and I would like to change the data source the reports use at run time based on a report parameter. Basically, the scenario we have is the following:
1)we created a library containing several report parameters and a data source. One of the parameters in the library is called "ds". The data source created uses a connection profile store that contains a JDBC Data source named "test"(the profile entry for the data source has the name attribute set to "test"). Also, in the Property Binding screen for the data source we set the Connection Profile Name to the "ds" parameter(params["ds"].value).
2) we created a report that uses the library described above and set the ds parameter to a value like "bla".
First, I would like to confirm that the Connection Profile Name refers to the name attribute of the profile tag in the connection profile store xml file.
When we run the report, although there is no data source named "bla" in the connection profile store, the report is generated using the the data source named "test". Why is this happening?
The second issue would be: at certain point more data sources could be created. In order to add a new data source is it enough to add a new element to the xml file containing the connection profile store? The profile tag has an id attribute, which for the test data source is set to a value like "b127d940-ac30-11de-b6b6-ca5b5147f014". If additional entries will be added later, should the values for the id field look in any specific way, or is it enough to be unique values? Is this id field used somewhere else?
Thanks
Find more posts tagged with
Comments
JasonW
Can you hard code the property binding value to a known profile name and see if that works?
make sure to set the expression type to constant and do not use quotes.
Jason
ccioriia
Thanks for replying, Jason.
It seems that the procedure I described above works, because I added another profile pointing to a database that does not contain the stored procedures I used in my report and I received an error when generating the report saying that there is no stored procedure with that name, as I expected. The thing is that if I pass to the ds parameter a value that does not match any of the profiles, it seems to use the information from the BIRT JDBC datasource tab.
The other thing is that I set the id attribute og the profile element for the second database(the one that does not have the stored procedures) to a a value that was obtained from the id of the other datasource profile and I am not sure of the consequences of this.
JasonW
Can you clear the JDBC info in the report?