我正在 SSRS 中创建报告,但遇到表格重复的问题。表 6 中应显示记录,但已显示 12 条记录。 左侧是具有重复行的表格。 这就是它在设计器中的样子(左表)
我找到了这个链接SSRS - 为什么我的表重复行?答案是应该删除默认设置的详细信息组。 我删除了“详细信息”组,然后添加了一个字段 (右表)
我现在遇到的问题是不显示重复项,但只显示一条记录,没有更多列表。 在上面的链接中,它指出需要设置聚合。我在哪里以及如何做?另外,如果还有其他解决方案,我将不胜感激。 对于信息我只有一个数据集。 我在查询中使用 fetchxml 从 Dynamics 365 获取记录。在该 fetchxml 中,我有两个链接实体(联系人和相关子帐户)。似乎只要两个链接实体位于一个 fetchxml 中并且子实体的属性可用,它就会开始重复行。
所以我找到了这个问题的解决方案。我开始为子记录创建不同的数据集,以便 fetchxml 中只有一个子表可用。 例如:
<?xml version="1.0"?>
<fetch distinct="true" mapping="logical" output-format="xml-platform" version="1.0">
<entity name="account">
<attribute name="name" />
<attribute name="accountid" />
<order descending="false" attribute="name" />
<filter type="and">
<condition attribute="accountid" value="@AccountId" operator="eq"/>
</filter>
<link-entity name="connection" from="record1id" to="accountid" link-type="outer" alias="connections">
<attribute name="record2roleid" />
<link-entity name="contact" from="contactid" to="record2id" link-type="outer" alias="contacts">
<attribute name="firstname" />
<attribute name="lastname" />
<attribute name="telephone1" />
<attribute name="emailaddress1" />
</link-entity>
<link-entity name="connectionrole" from="connectionroleid" to="record2roleid" link-type="outer" alias="role">
<attribute name="name" />
</link-entity>
</link-entity>
</entity>
</fetch>
这个xml实际上只有一个从“连接”开始的链接实体。如果我放置像这样进一步链接的实体
<link-entity name="connection" ... >
....
</link-entity>
<link-entity name="someEntity" ... >
<attribute name="someEntityField" />
</link-entity>
比 Tablix 中的行开始重复。 因此,只需使用另一个子实体创建另一个数据集并使用 tablix 中的字段即可。