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:
- Created new blank report in Visual Studio in my SSRS project. I have other SQL reports, but none are Pre-filtered.
- Created a new DataSource based on my Shared DataSource in the project.
- Added a hidden parameter called CRM_FilteredAccount with a default value of select \[account0\].* from FilteredAccount as "account0".
- Added a dataset referencing the datasource with a SQL query of
- 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)
- declare @sql as nVarchar(max)
- On the dataset, linked the query parameter "@CRM_FilteredAccount" to the report parameter.
- Clicked OK, entered select [account0].* from FilteredAccount as "account0" when prompted for the parameter value to get the fields.
- Added a table to the report, dragging AccountID and name to the fields and saved the report.
- In CRM, went to Customization, Customize the System.
- In the Reports section, added a new Report. Changed from Report Wizard to Existing File and browsed to my saved RDL file.
- Under Related Record Types, selected Account.
- Under Display in, I removed Reports area and added the List and Form items
- Clicked Save and Close
- Publish all customizations
- 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?