SSRS字段范围问题

dtc*_*dtc 4 reporting-services ssrs-2008

我有一个SSRS 2008 R2报告在表中使用此表达式:

=Lookup(Fields!DataSet1Date.Value, Fields!DataSet2Date.Value, Fields!DataSet2Price.Value, "DataSet2")
Run Code Online (Sandbox Code Playgroud)

我有2个数据集,并使用Lookup函数根据另一个数据集中的日期从一个数据集中获取数据.

我的问题是,这适用于我尝试过的机器,但其他人会遇到这样的错误:

Error   1       [rsFieldReference] The Value expression for the text box ‘Col_D2Price’ refers to the field ‘DataSet2Date’.  Report item expressions can only refer to fields within the current dataset scope or, if inside an aggregate, the specified dataset scope.
Error   2       [rsFieldReference] The Value expression for the text box ‘Col_D2Price’ refers to the field ‘DataSet2Price’.  Report item expressions can only refer to fields within the current dataset scope or, if inside an aggregate, the specified dataset scope. 
Run Code Online (Sandbox Code Playgroud)

我们还可以做些什么来解决这个问题?我们都使用相同的2008R2版本.

glh*_*glh 5

使用该LookUp功能时,我实际上得到了这个"幻像"错误.我把它称为幻像,因为我在哪里找不到原因,但是你弹出错误.

在我的情况下解决它的唯一方法是使用辅助功能LookUpSet.

希望我帮了.

编辑:

此外,你引起了我的兴趣,所以我做了一些研究:

  1. lookup功能仅适用于1对1的关系.
  2. loopupset函数用于1对多关系.
  3. multilookup函数用于许多1对1关系,即单个值的数组,其中第二个数据集中只有1个值.不相关但非常有趣.

我也遇到了一个潜在的修复方法.这是在新机器上尝试打开报告中的数据集和refresh all对话框中的字段.由于某种原因,这可能会将字段重新链接到此表达式.去图... Blockquote