Pass Record Id Dynamically As Parameter to SSRS Report Using Fetch Xml
As we know we can pass id dynamically in fetch Xml query by using parameter in SSRS report. In SSRS report our purpose to make report dynamic based on any condition. In condition whatever value is present we can make as parameter in report data. We will show you step to make parameter dynamic.
You can follow the below link for basic of SSRS report like How to create and what all component is require.
https://juniorcrmblog.blogspot.com/2022/02/ssrs-reports-for-dynamics-365-using.html
Step1: Create a Data Source to make sure which type of data source type we use to perform the query expression. Just right click on the data source and provide the name, Embedded connection type and Connection String(In connection string provide the Dynamic CRM URL like "https://juniorcrm.crm9.dynamics.com").
If you don't know what is the means of crm9,crm8,crm7 etc. please see the below link.
https://juniorcrmblog.blogspot.com/2022/02/what-does-crm1crm2-crm3crm4-mean-in.html
Step2: Add the dataset just right click on the dataset and give the name of dataset choose the Data Source and then provide the fetch xml query under the query type text.
Then click on the expression and remove the value part in fetch xml like below.
<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
<entity name="doc_doner">
<attribute name="doc_name" />
<attribute name="doc_issueddate" />
<attribute name="doc_donertype" />
<attribute name="doc_donerid" />
<attribute name="doc_date" />
<attribute name="doc_donernumber" />
<filter type="and">
<condition attribute="doc_donerid" operator="eq" uiname="Rakesh" uitype="doc_doner" value="{25435D78-E624-EB11-9FB4-0009AA0C9BF9}" />
</filter>
</entity>
</fetch>
After :
<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
<entity name="doc_doner">
<attribute name="doc_name" />
<attribute name="doc_issueddate" />
<attribute name="doc_donertype" />
<attribute name="doc_donerid" />
<attribute name="doc_date" />
<attribute name="doc_donernumber" />
<filter type="and">
<condition attribute="doc_donerid" operator="eq" value= "@CRM_doc_donerid"/>
</filter>
</entity>
</fetch>
Step 3: Go the parameter and right click and create it and used it in fetch Xml.
Comments
Post a Comment