简体   繁体   English

Dynamics CRM报告不显示数据

[英]Dynamics CRM Report doesn't show data

I've run into a problem where when I upload my Custom Reports to Dynamics CRM it doesn't show any data in the reports. 我遇到了一个问题,当我将自定义报告上载到Dynamics CRM时,报告中没有显示任何数据。 In my reports I used stored procedures which are stored in a separate database called "CustomReports". 在我的报告中,我使用了存储过程,这些存储过程存储在名为“ CustomReports”的单独数据库中。 I've done a few tests to see if I could pinpoint what exactly was causing the issue but unfortunately I had no luck. 我已经进行了一些测试,以查看是否可以确切地找出导致问题的原因,但不幸的是我没有运气。 Below are the list of tests that I tried: 以下是我尝试过的测试列表:

  1. Uploaded a Report using my "CustomReports" database to access data from the CRM filtered views. 使用我的“ CustomReports”数据库上载了报告,以从CRM过滤的视图中访问数据。 -- No Data Returned - 没有数据返回
  2. Ran this exact Report in our Report Manager -- Data Returned 在我们的报表管理器中运行此确切报表- 数据返回
  3. Uploaded a Report using my "CustomReports" database to access data from the CRM non-filtered views -- Data Returned 使用我的“ CustomReports”数据库上传报告,以从CRM非过滤视图访问数据- 返回数据
  4. Uploaded a Report using the CRM database and filtered-views. 使用CRM数据库和过滤视图上传了报告。 -- Data Returned - 返回的数据

I thought it might be related to the CRM security model until I ran Test 4 above. 我以为它可能与CRM安全模型有关,直到我运行上述测试4。 Now I'm completely stumped. 现在我完全陷入了困境。 Why is it that when I call stored procedures that use filtered views from my Custom database it doesn't show results but when I write the same query using CRM as my datasource it does return results? 为什么当我调用使用自定义数据库中经过过滤的视图的存储过程时,它不显示结果,但是当我使用CRM作为数据源编写相同的查询时,它却返回结果吗? If anybody has run into a similar situation or has an idea on how to fix this it would be greatly appreciated. 如果有人遇到类似情况或有解决办法的想法,将不胜感激。

Since it is accessing a CRM Filtered view it is going to be security trimmed by the user that SQL is using to access the Filtered view from the custom database. 由于它正在访问“ CRM筛选”视图,因此将使用SQL来从自定义数据库访问“筛选”视图的用户对其安全性进行调整。 I do not believe that the CRM based report will access the datasource point to CustomReports as the CRM user running the report. 我不认为基于CRM的报表将作为运行报表的CRM用户访问CustomReports的数据源点。 Therefore, you need to make sure that whatever user account SSRS and SQL end up using is a valid user in CRM and has read permission to the relevant data. 因此,您需要确保最终使用的用户帐户SSRS和SQL都是CRM中的有效用户,并且具有对相关数据的读取权限。

If you can access the data using step # 4 that is the preferred and supported method for getting data into a report. 如果您可以使用第4步访问数据,则这是将数据获取到报表中的首选和受支持的方法。 I know that traditionally we want to write Stored Procs for reports but this goes outside the Dynamics CRM model. 我知道,传统上我们想为报表编写存储过程,但这超出了Dynamics CRM模型。 It can usually be done, assuming you aren't using CRM online, but you are introducing more complexity which is not well documented for CRM. 假设您没有在线使用CRM,通常可以做到这一点,但是您会引入更多的复杂性,而对于CRM而言,这种复杂性并没有得到很好的证明。

NickNow's response helped guide me to what the problem was. NickNow的回答帮助我找到了问题所在。 As he stated the user credentials for my CRM user weren't being passed through to my CustomReport database because I was using an Integrated Security connection type to that data source. 正如他所说,我的CRM用户的用户凭据未传递到CustomReport数据库,因为我对该数据源使用了集成安全性连接类型。 As a result I believe I was being connected to the DB as the CRM App Service user which isn't an actual CRM logon user hence the CRM security model filtered out all the data from my reports. 结果,我相信我以不是真正的CRM登录用户的CRM应用服务用户身份连接到数据库,因此CRM安全模型从报告中过滤掉了所有数据。

The way I got around this was by setting my CRM database as my DataSource, instead of my CustomReport database. 我解决此问题的方法是将CRM数据库设置为DataSource,而不是CustomReport数据库。 Then in my report query I executed my stored procedure from my CustomReport DB. 然后在报表查询中,我从CustomReport数据库执行了存储过程。 So my query was: EXEC CustomReport.dbo.StoredProcedure 所以我的查询是: EXEC CustomReport.dbo.StoredProcedure

This made the data show up in my reports. 这使数据显示在我的报告中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM