如何从创建参数中汲取字段值
我创建了一个参数 [GroupID],用于查询 SSRS 报告中的多个数据集。它使用我的 GroupList_Rolling12 数据集中的字段 [GroupID]。 [GroupID] 的示例是 77610N。选择 77610N 后,我的所有数据集都会针对此 [GroupID] 正确“过滤”。
我现在需要创建一个返回 [GroupID] 的 [GroupName] 的文本框。换句话说,当从我的 GroupID 参数中选择 77610N 时,我希望显示与所选 GroupID 参数关联的 [GroupName]。
我对 SSRS 还很陌生,无法弄清楚这一点。我尝试创建表达式 =First(Fields!GroupName.Value, "GroupList_Rolling12") 但这不起作用,因为它只是返回查询中的第一个值。
我也尝试过 =First(Parameters!GroupID.Value(0)) 但这也不起作用
我也尝试过这个表达式 =Lookup(Fields!GroupID.Value, Fields!GroupID.Value, Fields!GroupName.Value, "GroupList_Rolling12" ) )
你能帮忙吗?
I created a parameter [GroupID] that is used to query several datasets in my SSRS report. It is using the field [GroupID] from my GroupList_Rolling12 dataset. An example of [GroupID] is 77610N. When 77610N is selected, all of my datasets are correctly 'filtering' for this [GroupID].
I now need to create a text box that returns the [GroupName] of [GroupID]. In other words, when 77610N is selected from my GroupID parameter, I want the [GroupName] that is associated with the selected GroupID parameter to display.
I'm still very new to SSRS and cannot figure this out. I tried creating the expression =First(Fields!GroupName.Value, "GroupList_Rolling12") but that did not work since it simply returns the first value from the query.
I also tried =First(Parameters!GroupID.Value(0)) but this also did not work
I also tried this expression =Lookup(Fields!GroupID.Value, Fields!GroupID.Value, Fields!GroupName.Value, "GroupList_Rolling12")
)
Can you please help?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
参数标签
您可以直接引用类似的 将选择第一个选定的条目。
You can reference the parameter label directly like this
There is no need to put the index on the end (
=Parameters!GroupID.Label(0)
) unless your parameter is multi-value, in which case it would select the first selected entry.