简体   繁体   English

SSRS 如何访问表达式中的共享数据集值

[英]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.我需要在 SSRS 项目的某个位置设置连接字符串,以便在所有报告的数据源中使用它。 As SSRS doesn't support project params it's recommended to create Shared DataSet instead, eg HostParam.rds由于 SSRS 不支持项目参数,因此建议改为创建共享数据集,例如 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给出错误 'HostParam' 未声明

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).然后,您在创建数据集时 select 这个共享数据源(这适用于共享数据集或嵌入数据集)。

If you change the connection in the shared data source, this is reflected in all the datasets and therefore reports that reference it.如果您更改共享数据源中的连接,这将反映在所有数据集中,因此报告引用它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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