Dynamics 365 CRM - 从SSRS报告中删除外部联接重复项

问题描述 投票:2回答:1

我在Dynamics 365中遇到SSRS报告的问题。我有一个名为entity1的自定义实体,它与连接实体有1:N的关系。

entity1中的每条记录都可以有多个连接,有些记录可能根本没有连接。

我创建了一个SSRS,fetchXML报告,使用entity1作为主要实体,并使用外部联接来链接连接,这很好。

报告看起来像这样:

**Name (entity1)**    |   **Stakeholder (Connection)**   |   **Role (Connection)**

Hotel Name 1          |           Joe Bloggs             |         Designer

Hotel Name 1          |           Jane Doe               |         Developer

Hotel Name 2          |                                  |         

Hotel Name 3          |           Joe Bloggs             |         Designer 

但是,我希望报告看起来像这样(entity1有很多列):

Hotel Name 1          |           Joe Bloggs             |         Designer

                      |           Jane Doe               |         Developer

Hotel Name 2          |                                  |         

Hotel Name 3          |           Joe Bloggs             |         Designer 

有没有办法在SSRS报告构建器/ FetchXML语句中执行此操作,还是需要在SQL中执行某些操作?

我的fetchXML看起来像这样:

    <fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
  <entity name="entity1">
    <attribute name="new_id" />
    <attribute name="new_name" />
    <attribute name="new_city" />
    <attribute name="ownerid" />
    <order attribute="new_name" descending="false" />
    <filter type="and">
      <condition attribute="new_city" operator="eq" value="London" />
    </filter>
    <link-entity name="connection" from="record1id" to="new_newbuildlistid" link-type="outer" alias="con">
    <attribute name="record2id" />
    <attribute name="record2roleid" />
    <attribute name="connectionid" />
    <attribute name="record1id" />
    <filter type="and">
      <condition attribute="record2id" operator="not-null" />
      <condition attribute="record2roleid" operator="not-null" />
    </filter>
    </link-entity>
  </entity>
</fetch>
sql reporting-services dynamics-crm dynamics-365 fetchxml
1个回答
2
投票

你在FetchXML中做的事情并不多。 Fetch只是(正确地)返回数据,这个问题都是关于该数据的呈现。

您需要对此演示文稿的报告实施一种分组形式。例如Create a Stepped Report

创建分步报告

  1. 创建表格报告。例如,插入Tablix数据区域并向“数据”行添加字段。
  2. 将父组添加到报表中。

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.