内部联接打破了SSRS

时间:2015-01-09 18:56:12

标签: sql sql-server reporting-services dynamics-crm-2011

我有一个问题:

SELECT systemuser.fullname AS 'fullname',
   usersettings.calendartype AS 'calendartype', 
   usersettings.uilanguageid AS 'uilanguageid' 
FROM   filteredsystemuser AS systemuser 
   INNER JOIN filteredusersettings AS usersettings 
           ON systemuser.systemuserid = usersettings.systemuserid 
inner join vfinduserguid vfg
on systemuser.systemuserid = vfg.userguid

我已转换为FetchXML:

<fetch mapping="logical">
  <entity name="systemuser">
    <attribute name="fullname" alias="fullname" />
    <link-entity name="usersettings" to="systemuserid" from="systemuserid" alias="usersettings" link-type="inner">
      <attribute name="calendartype" alias="calendartype" />
      <attribute name="uilanguageid" alias="uilanguageid" />
      <link-entity name="vfinduserguid" to="systemuserid" from="userguid" alias="vfg" link-type="inner" />
    </link-entity>
  </entity>
</fetch>

使用此服务:http://www.sql2fetchxml.com/

当我尝试在SSRS中使用这个FEtchXML时,我得到了:

enter image description here

Microsoft Dynamics CRM中不存在特定记录类型。

我做错了什么?

请注意,这是破坏它的最后一个连接(vfinduserguid)。这个对象是一个观点。

1 个答案:

答案 0 :(得分:2)

这是获取当前用户的提取:

<fetch version="1.0" output-format="xml-platform"
       mapping="logical" distinct="false">
   <entity name="systemuser">
      <attribute name="fullname" />
      <attribute name="systemuserid" />
      <order attribute="fullname" descending="false" />
      <filter type="and">
         <condition attribute="systemuserid"
                    operator="eq-userid" />
      </filter>
   </entity>
</fetch>

http://crmtipoftheday.com/2014/01/09/reflecting-current-user-ssrs/