Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 79901

Help with Pre-Filtered SQL Report for On-Premise

$
0
0

I cannot for the life of me get a Pre-Filtered SQL Report to work with on our On-Premise CRM server running 8.2. 

I'm trying to create a very simple SQL report that will only run on the currently opened account.  Even though what I'm currently doing is very simple, I'm using SQL because the end result that I'd like to achieve will require complex queries.

Issue:After I upload my report to CRM, and go to a specific Account; I only see the new report under the Run on All Records rather than Run on Current Record.

Steps Taken:

  1. Created new blank report in Visual Studio in my SSRS project.  I have other SQL reports, but none are Pre-filtered.
  2. Created a new DataSource based on my Shared DataSource in the project.
  3. Added a hidden parameter called CRM_FilteredAccount with a default value of select  \[account0\].*  from  FilteredAccount as "account0".
  4. Added a dataset referencing the datasource with a SQL query of
    1. declare @sql as nVarchar(max)

      set @sql = '
      SELECT top 10 CAST(accountid as nvarchar(100)) as AccountID, name
      FROM (' + @CRM_FilteredAccount + ') as fa'

      exec(@sql)
  5. On the dataset, linked the query parameter "@CRM_FilteredAccount" to the report parameter.
  6. Clicked OK, entered select [account0].*  from  FilteredAccount as "account0" when prompted for the parameter value to get the fields.
  7. Added a table to the report, dragging AccountID and name to the fields and saved the report.
  8. In CRM, went to Customization, Customize the System.
  9. In the Reports section, added a new Report.  Changed from Report Wizard to Existing File and browsed to my saved RDL file.
  10. Under Related Record Types, selected Account.
  11. Under Display in, I removed Reports area and added the List and Form items
  12. Clicked Save and Close
  13. Publish all customizations
  14. Browse to a specific account and the new report is only under Run on All Records

I based what I did above on reading multiple articles and tearing apart the Account Overview report, which kind of behaves the way I want my report to work.

Does anybody have any idea why the report won't display under Run on Current Record? 


Viewing all articles
Browse latest Browse all 79901

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>