简体   繁体   中英

In MS Reporting Services, how do you set a dynamic dataset, based on a selectable Report database parameter

In MS Reporting Services, how do you set a dynamic dataset, based on a selectable Report database parameter?

For example, I have one dataset, Insurers, that has a text SQL Query, instead of a stored procedure, and I need to use the database that is selected by the user in the Report database parameter as the datasource for the Insurers dataset.

假设数据库总是在同一实例中,则可以通过为查询使用表达式字符串并将数据库参数连接到查询的FROM子句中来更简单地执行此操作。

I was able to figure it out.

In the Data Source Properties, I select Embedded connection. And then in the connection string, I created a dynamic expression.

= "Data Source=" & Parameters!ServerName.Value & ";Initial Catalog=" & Parameters!Database.Value & ";Persist Security Info=True;User ID=userID;Password=password;Connection Timeout=260;"

And then on the Report Server, after deploying the report, I select custom datasource, and put in the username and password for the datasource. The connection string should show the text next to it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM