Answered by:
Dynamically populated parameters with Dynamic DataSource in SSRS

Question
-
I'm facing an issue with SSRS reports. Below is the scenario.
I have SSRS reports with embedded DataSource configured to point dynamically to different databases. I'm achieving this by passing the Connection String as a parameter to the report.
The following is the expression used in the DataSource:
="Data Source = " & Parameters!Server.Value & "; Initial Catalog = " & Parameters!Database.Value & ";"
This works fine for a report which does not require the available values to be populated dynamically from a query.
In a scenario where the parameters needs to be populated dynamically from a query this doesn’t hold good. If I run the report with the same configuration I'm getting the following exception “Error during processing of the ConnectString expression of data source”.
I understand this is because the Report has to connect to the database to populate the parameter values and we are passing the connection string only when the report is executed.
Is there any way to achieve Dynamically populated parameters with Dynamic DataSource in SSRS? I'm using SQL Server 2008 R2.
Any help is highly appreciated. Thanks!
- Edited by Aditya Donthi Thursday, March 21, 2013 10:49 AM
Thursday, March 21, 2013 10:48 AM
Answers
-
I was able to fix the issue.
Just had to move the Connection string parameters (Server and Database) to top of other parameters.
- Marked as answer by Aditya Donthi Friday, March 22, 2013 9:51 AM
- Edited by Aditya Donthi Friday, March 22, 2013 9:51 AM
- Unmarked as answer by Aditya Donthi Friday, March 22, 2013 2:43 PM
- Marked as answer by Aditya Donthi Friday, March 22, 2013 2:44 PM
Friday, March 22, 2013 9:50 AM
All replies
-
To dynamically populate your parameters, you need to get data from somewhere, which means you need to connect to any type of datasource. So I guess no.
Please mark as answered or vote helpful if this post help resolved your issue. Thanks!
k r o o t z- Proposed as answer by Charlie Liao Friday, March 22, 2013 8:27 AM
Thursday, March 21, 2013 10:53 AM -
I was able to fix the issue.
Just had to move the Connection string parameters (Server and Database) to top of other parameters.
- Marked as answer by Aditya Donthi Friday, March 22, 2013 9:51 AM
- Edited by Aditya Donthi Friday, March 22, 2013 9:51 AM
- Unmarked as answer by Aditya Donthi Friday, March 22, 2013 2:43 PM
- Marked as answer by Aditya Donthi Friday, March 22, 2013 2:44 PM
Friday, March 22, 2013 9:50 AM