SSRS:在参数中显示与登录域中不同的词(别名)

huangapple go评论57阅读模式
英文:

SSRS: Display a different word (alias) in parameter than that in login domain

问题

我正在为多家相关公司创建报告,并使用用户的登录域来限制数据只显示他们所属的公司。问题在于域名与公司名称不匹配。我需要在参数中显示公司名称,以消除对他们所看到的内容的困惑,特别是对于使用多个域名登录的用户。这是否有可能?如果可以,请提供一些说明。

我正在使用以下语句来提取域名:=Split(User!UserID, ""\").GetValue(0)

例如:域名/登录如xyz/bsmith,但我需要显示ABC而不是域名xyz
域名/登录如mno/ajordan,但我需要显示JKL而不是域名mno

我有一个包含域名和公司名称的表,或者我可以创建表之间的连接来完成相同的操作。

我可能在错误的方法中搜索此问题,但我找不到类似这个问题的答案。

已尝试谷歌搜索多个相关短语,以及尝试在stackoverflow内部搜索,但没有成功。

英文:

I am creating a report for several related companies and using the user's login domain to restrict the data to thier specific company. The problem is that the domain doesn't match the company name. I need to display the company name in the parameter to eliminate confusion as to what they are seeing, especially for the users that login using multiple domains. Is this possible? If so please provide some instructions.

I am using the following statement to pull the domain: =Split(User!UserID, "\").GetValue(0)

EX: domain/login like xyz/bsmith, but i need to display ABC instead of the domain xyz
domain/login like mno/ajordan, but I need to display JKL instead of the domain mno

I do have a table that contains the domains and company names, or I can create a join between tables to do the same thing.

I may be searching for this the wrong way, but I can't find any questions like this issue.

Googled several related phrases, as well as attempted to search inside stackoverflow with no success.

答案1

得分: 1

我不确定我是否理解您的问题,因为您已经有一个包含域名和公司名称的表,所以只需创建一个名为dsCompany的数据集,查询类似于:

SELECT Company FROM myTable WHERE DomainName = @userdomain

这应该会自动将userdomain参数添加到您的报表中,但如果没有,请手动创建一个(它们区分大小写,所以请检查拼写),然后将其默认值设置为:

=Split(User!UserID, "\").GetValue(0)

如果这不起作用,请详细说明情景,模拟一些用户期望看到的图像等。

英文:

I'm not sure if I understand what your problem is as you already have a table with the domains and company names so just create a dataset called say dsCompany with a query something like

SELECT Company FROM myTable WHERE DomainName = @userdomain

This should automatically add a userdomain parameter to your report, but in case that didn't happen, just create one (they are case sensitive so check spelling) then set its default value to

=Split(User!UserID, "\").GetValue(0)

If this does not help, please explain the scenario in a bit more detail, mock up some images of what you expect the users to see etc..

huangapple
  • 本文由 发表于 2023年3月7日 06:01:43
  • 转载请务必保留本文链接:https://go.coder-hub.com/75656234.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定