【问题标题】:How to populate a Tablix referencing data from another Tablix dataset?如何填充来自另一个 Tablix 数据集的 Tablix 引用数据?
【发布时间】:2016-11-16 00:17:35
【问题描述】:

我有两个TablixTablix ATablix B

每个Tablix 都连接到不同的datasets,如下图所示:

如何通过在 Tablix A 中查找数据来填充 Tablix B?

例如:Tablix A 包含车辆模型,但我还需要使用两个数据集中的 VehicleID 为 Tablix B 填充车辆颜色。

使用Lookup Function,这仅在两个数据集都是同一个 tablix 中的引用时才有效,我如何使用单独的 tablix 做到这一点?

尝试使用单独的 tablix,我收到以下错误:

[rsFieldReference] The Value expression for the text box 
‘Textbox57’ refers to the field ‘VehicleColor’.  

Report item expressions can only refer to fields within the current dataset scope or, 
if inside an aggregate, the specified dataset scope. 
Letters in the names of fields must use the correct case.

插图:

【问题讨论】:

  • 你的表情是什么。
  • 我正在使用这里解释的表达式:msdn.microsoft.com/en-us/library/ee240819.aspx=LookupSet(Fields!TerritoryGroupID.Value, Fields!ID.Value, Fields!StoreName.Value, "Stores")
  • 你试过只使用“查找”

标签: reporting-services ssrs-2012 ssrs-tablix


【解决方案1】:

您可以使用“查找”从另一个数据集中获取单个值。例如:

=Lookup(Fields!VehicleID.Value, Fields!VehicleID.Value, Fields!VehicleColour.Value, "Vehicles")

会在 ID 匹配的地方显示一个(数据集中的第一个)VehicleColour。如果两个数据集之间只有一个 ID 匹配,则将返回正确的颜色。

=LookupSet(Fields!VehicleID.Value, Fields!VehicleID.Value, Fields!VehicleColour.Value, "Vehicles")

导出一个数组,如果它使用连接转换为字符串,它只能显示在文本框中:

=join(LookupSet(Fields!VehicleID.Value, Fields!VehicleID.Value, Fields!VehicleColour.Value, "Vehicles"), ", ")

这将显示一个逗号分隔的 ID 匹配的所有 VehicleColours 列表。

有关查找的更多信息,请参阅:https://msdn.microsoft.com/en-GB/library/ee210531.aspx

有关 Lookupset 的更多信息,请参阅:https://msdn.microsoft.com/en-us/library/ee240819.aspx

【讨论】:

    猜你喜欢
    • 2016-12-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-12-25
    • 1970-01-01
    • 2014-11-19
    相关资源
    最近更新 更多