Adding SSRS report through CRM2016: Prefiltering doesn't work?
<p>I've created a custom Reporting Services report from within Visual Studio that is intended to use automatic prefiltering as <a href="https://social.microsoft.com/Forums/en-US/ddadbb49-8319-4ba8-8a08-21b930a31beb/crm-report-run-on-selected-records?forum=crm" rel="nofollow noreferrer">described here</a>.</p>

<p>So, I've created my query as follows:</p>

<pre><code>select fullname, createdbyname, createdon
from FilteredContact as CRMAF_FilteredContact
order by createdon desc
</code></pre>

<p>However, once I add a new Report in CRM based on the report's .rdl file (as <a href="http://crmbook.powerobjects.com/system-administration/advanced-reporting-options/" rel="nofollow noreferrer">described under "Deploying the Report" here</a>) it adds the report fine, but two things happen:</p>

<p>1) The shared data source for this report is initally invalid, both CRM and SSRS refuse to render it with the error:
<code>"The report server cannot process the report or shared dataset. The shared data source 'MyOrg_MSCRM' for the report server or SharePoint site is not valid. Browse to the server or site and select a shared data source. (rsInvalidDataSourceReference)"</code></p>

<p>I have to manually set the DataSource from within SSRS to <code>/MyOrg_MSCRM/CustomReports/MSCRM_DataSource</code> to get it to work.</p>

<p>2) The report doesn't appear under "<em>Run on Selected records</em>" but under "<em>Run on All Records</em>", and doesn't perform any prefiltering.<br>
Also, when I download the .rdl from SSRS it hasn't modified it, neither adding an extra parameter or changing the SQL query. as I would have expected <a href="https://blogs.msdn.microsoft.com/crm/2009/03/06/microsoft-dynamics-crm-pre-filtering-tips/" rel="nofollow noreferrer">based on this information</a>.</p>

<p>What could I be doing wrong?</p>

<p>I'm using MS CRM 2016 update 1 (v8.1.0.359) on premise, with SQL Server 2014 Reporting Services and the SRS Data Connector installed on the same machine.</p>