External assembly reference the same DB data source as the calling report
I have a SSRS 2012 report which references a custom c# assembly. This report exists in multiple environments (alpha, beta and production ) which
are each associated with different data sources.
Is there a way for the assembly to determine the datasource used by the calling report so it can also connect to it?
Is there a way for the assembly to determine the datasource used by the calling report so it can also connect to it?
August 25th, 2015 11:58am
Hi,
According to your description, you want to create a dynamic data source, right?
In Reporting Services, if we want to connect to a dynamic data source, we can use a report parameter to connect the required data source. In your scenario, the end-user can select the predefined parameter value to connect to the data source, please refer to the following steps:
- Create a embedded data source and data set to create a connection to the data source.
- Create a table and drag the fields into the table. Preview the report to make sure it works properly.
- If the report works properly, change the data source with the following expression:
="Data Source="+Parameters!Datasource.Value+";Initial Catalog="+Parameters!Database.value
Note: You need to set the parameter value.
The result is like below:
Reference:
How to use Dynamic data sources in your SSRS report.
If you have any question, please feel free to ask.
Regards,
Shrek Li
If you have any feedback on our support, please click here.
Free Windows Admin Tool Kit Click here and download it now
August 25th, 2015 10:39pm