【问题标题】:How do I link the same entity in FetchXml (ssrs) with a different prefilterparametername?如何将 FetchXml (ssrs) 中的同一实体与不同的 prefilterparametername 链接?
【发布时间】:2019-04-02 15:44:32
【问题描述】:

我正在为 Dynamics CRM 构建 SSRS 报告,因此我必须使用 FetchXml。例如,我有 10 个帐户,我必须从第二个查询中减去 5 个帐户。

我准备了2个fetchxml报告参数:

10 个帐户的 CRM_FilteredAccount

CRM_FilteredAccountNeg 我必须减去的帐户

我有如下所示的数据集。

到目前为止的数据集:

<fetch distinct="false" useraworderby="false" no-lock="false" mapping="logical" >
  <entity name="account" enableprefiltering="1" prefilterparametername="CRM_FilteredAccount" >
    <attribute name="name" alias="name" />
  </entity>
</fetch>

(不工作)具有不同参数的链接实体的数据集:

<fetch distinct="false" useraworderby="false" no-lock="false" mapping="logical" >
  <entity name="account" enableprefiltering="1" prefilterparametername="CRM_FilteredAccount" >
    <attribute name="name" alias="name" />
    <link-entity name="account" enableprefiltering="1" prefilterparametername="CRM_FilteredAccountNeg" from="accountid" to="accountid" link-type="outer" alias="neg" >
      <filter>
        <condition entityname="neg" attribute="accountid" operator="null" />
      </filter>
    </link-entity>

  </entity>
</fetch>

我预计第一个过滤器参数会给出 10 个帐户的结果。 然后使用带有第二个过滤器参数的链接实体给出仅剩下 5 个帐户的结果。

【问题讨论】:

    标签: reporting-services visual-studio-2015 fetchxml xrm


    【解决方案1】:

    好吧,让我们执行以下操作: 第一个数据集我们称之为“负” 对于此数据集,使用 fetchxml 检索帐户 ID 不为空的帐户。 该数据集将为我们提供 5 条记录。 现在对于这个数据集,我们将使用 accountid 字段作为参数,调用是“NegativeAccounID”,即它将包含所有帐户的 Guid,这些帐户必须从我们的 Next fetchxml 中排除

    现在是第二个数据集,我们称之为“结果” 对于这个数据集,使用 fetchxml 检索所有 accountid 不等于我们定义的 NegativeAccountId(参数)的帐户。

    这会给你准确的结果。

    您将不得不不希望参数的工作方式。

    【讨论】:

      猜你喜欢
      • 2019-04-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-10-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-02-03
      相关资源
      最近更新 更多