简体   繁体   中英

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. In my reports I used stored procedures which are stored in a separate database called "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. -- 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
  4. Uploaded a Report using the CRM database and filtered-views. -- Data Returned

I thought it might be related to the CRM security model until I ran Test 4 above. 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? 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. I do not believe that the CRM based report will access the datasource point to CustomReports as the CRM user running the report. 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.

If you can access the data using step # 4 that is the preferred and supported method for getting data into a report. I know that traditionally we want to write Stored Procs for reports but this goes outside the Dynamics CRM model. 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.

NickNow's response helped guide me to what the problem was. 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. 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.

The way I got around this was by setting my CRM database as my DataSource, instead of my CustomReport database. Then in my report query I executed my stored procedure from my CustomReport DB. So my query was: EXEC CustomReport.dbo.StoredProcedure

This made the data show up in my reports.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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