Hi,
Assume you have to display related ‘contacts’ of an ‘Account’ in the report hosted in an IFrame.
You can prepare a dataset using below query in the report
SELECT * FROM FilteredContact C
WHERE
C.accountid=@CRM_AccountId
To set parameter ‘@CRM_AccountId‘, you can pass parameter in the URL in this format "&p:CRM_AccountId="={Account GUID}"
Sample URL
var url = Xrm.Page.context.getServerUrl() + “/crmreports/viewer/viewer.aspx?action=run&context=records&helpID=Internal%20Call%20Report.rdl&id=%7bcd80109a-dc7c-e111-a040-00155dc87c64%7d&records=%7b245DB4C3-927C-E111-9FA1-00155DC87C64%7d&recordstype=1+ “&p: CRM_AccountId=” + accountId;
Below is the useful article explained in detail
Hope it helps 🙂

![[Step by Step] Beginner : Create a PCF control and add it to a custom page](https://rajeevpentyala.com/wp-content/uploads/2024/12/image-49.png)

Leave a reply to prasun2005 Cancel reply