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

标签 sql reporting-services dynamics-crm dynamics-365 fetchxml

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

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

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

报告看起来像这样:

**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>

最佳答案

为此,您在 FetchXML 中无能为力。 Fetch 只是(正确地)返回数据,这个问题都是关于该数据的呈现。

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

To create a stepped report

  1. Create a table report. For example, insert a tablix data region and add fields to the Data row.

  2. Add a parent group to your report.

enter image description here

关于sql - Dynamics 365 CRM - 从 SSRS 报告中删除外部联接重复项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54533019/

相关文章:

javascript - 无法从展开中检索属性

wcf - CRM 2011 : Reauthentication with _serviceProxy. 身份验证()

php - 我想要在 mysql-php 中以 001 开头的自动递增列 "ID"?使用 phpmyadmin 如何做到这一点

reporting-services - 表达式IF ELSE

sql - 违反 UNIQUE KEY 约束无法在对象中插入重复的键

reporting-services - SSRS如何获取从开始日期到结束日期的进出库存总量?

c# - 从 MS CRM 工作流事件调用 SQL Server Reporting Services

sql - 将 SQL 查询转换为 Dynamics CRM FetchXML 查询的工具

java - SQL "CREATE TABLE"查询在 Java 中不起作用

sql - 如何使用Oracle获得年龄,月份和天数的年龄