简体   繁体   中英

SSRS how to access Shared DataSet values in expression

I need to set the connection string somewhere in one place in SSRS project in order to use it in Data Sources across all the reports. As SSRS doesn't support project params it's recommended to create Shared DataSet instead, eg HostParam.rds

SELECT 'localhost' AS GlobalParameter

The question is how to access it further in expression in Data Source connection string

="Data Source=" + HostParam.GlobalParameter + ";Initial Catalog=xxx"

gives an error 'HostParam' is not declared

You can setup a shared datasource at the project level, this contains just the connection to the database.

You then select this shared datasource when creating datasets (this works for both shared datasets or embedded datasets).

If you change the connection in the shared data source, this is reflected in all the datasets and therefore reports that reference 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