Dynamics 365 Enable pre-filtering for SSRS report:
When implementing an SSRS report in CRM, you might want to run a report on a specific record. For example run a report for the opening Account, Contact.
Normally, the user will manually enter a value for a parameter (a GUID of record) for report when running report
In this article, I'll show you how to build an SSRS report (fetch XML base) that runs on a specific Account.
We'll build a report to show account information and a list of related contacts in a table.
Prerequisite:
- Some experience in SSRS report
- Some experience in Fetch XML query
Here is the report that we're going to build:
Step 1: Create a new empty report. You can create a report using Visual Studio or Report Builder
Step 2: Add dataset for our report.
Hint: you can use Advanced Find in CRM to build a fetch XML query then copy it to data set query
The key points here are 2 properties in the "link-entity":
- enableprefiltering="1": To enable pre-filtering for the primary or linked entity in a Fetch-based report, you must set the value of the enableprefiltering parameter to “1”, and specify a parameter name in the prefilterparametername property.
- prefilterparametername="CRM_FilteredAccount"
When you create dataset with enableprefiltering, a new parameter is created automatically

And the dataset will contain a parameter:

It's done, let's deploy this report to CRM and run a report in an Account.
You need to create an Account and some Contacts link to this Account, then open the Account and run our report


If you click on the button "Filter", you will see the current Account are filtered automatically.

*This post is locked for comments