Scenario :
> We have CRM and SSRS report ,
> CRM has Button/URL text field on form.
> SSRS have a parameter Called “SourceStatus“.
Requirement :
> When user Click the link/Button in CRM to open report, User should see all records based on parameter passed from CRM to SSRS.
> Report link to be attached for each record for that entity.
This Can be the client requirement to pass value from current record to SSRS report.
I have CRM which has one field with data format URL.
I have SSRS Report Which accept parameter named “SourceStatus”
To Connect to CRM from SSRS Please refer my blog here
So how you pass parameter to report link of CRM and in SSRS report how to fetch Data from that parameter.
When you run Report in CRM links look like
https://orgName.crm.dynamics.com/crmreports/viewer/viewer.aspx?action=filter&helpID=Account%20Overview.rdl&id=%7b2B2A692E-7D04-E711-80E6-00155DB8652A%7d
But now say i want to add one more Query string after id and my URL will look like
https://orgName.crm.dynamics.com/crmreports/viewer/viewer.aspx?action=filter&helpID=Account%20Overview.rdl&id=%7b2B2A692E-7D04-E711-80E6-00155DB8652A%7d&SourceStatus=Value
if you pass this directly , Report Viewer will not understand the string and will not run the report.
So to add your custom Query string in Report link you have to make changes in URL(add P:) which notify viewer that there are some custom query-string which will be used by report parameter.
So new Working URL looks like
https://orgName.crm.dynamics.com/crmreports/viewer/viewer.aspx?action=filter&helpID=Account%20Overview.rdl&id=%7b2B2A692E-7D04-E711-80E6-00155DB8652A%7d&p:SourceStatus=Value
So P: before query string is very important to notify CRM that Reports has some custom parameters.
Now in Reports project you must have one parameter with Name SourceStatus.
and to get value from parameter in fetch XML or any Expression in Reports we use @parameterName. In our case it is @SourceStatus.
Now you can get value of this Record specific attribute or custom value in reports fetch XML.
This way you can achieve the requirement of passing value of CRM to SSRS report from CRM.
Hope it helps.
Thank you.
*This post is locked for comments