sql - Dynamics 365 CRM - 从 SSRS 报告中删除外部联接重复项
问题描述
我在 Dynamics 365 中遇到 SSRS 报告问题。我有一个名为 entity1 的自定义实体,它与连接实体具有 1:N 关系。
entity1 中的每条记录都可以与它有多个连接,并且某些记录可能根本没有连接。
我创建了一个 SSRS,使用 entity1 作为主要实体并使用外部连接来链接连接的 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 只是(正确地)返回数据,这个问题都是关于数据的呈现。
您将需要为此演示文稿的报告实施一种分组形式。例如创建分步报告。
创建阶梯式报告
创建表格报告。例如,插入一个 tablix 数据区域并将字段添加到数据行。
将父组添加到您的报告中。
推荐阅读
- c++ - 使用 FFmpeg API 的示例 C 代码中的问题
- ios - 如何防止移动 Chrome/Safari 中的对角滚动
- javascript - 匹配两个特殊字符之间的子字符串,不包括字符
- angular - 如何从 Angular 材质对话框中获取数据?
- api - 如何从 localhost 向 api 发出 fetch 请求?
- asp.net - 如何使用 WebApi 返回 IEnumerable 对象列表?
- reactjs - 按下按钮后无法清除输入字段
- python - 如何查看在 python 中发送的 cookie
- elixir - 我在使用 ExAws 时收到错误 (FunctionClauseError) no function clause matching in :raw_file_io_raw.open_layer/3
- search - 如何在 Apache Solr 中创建包罗万象的复制字段?