CRM 2011 + SSRS Custom Report Passing parameters.

In CRM 2011 sometimes you need to pass parameters in the query string to your SSRS report which open via the CRM ReportViewer control inside an IFrame.

The following url is the way you want to load a report inside an IFrame.

var reportUrl = <strong>serverUrl</strong> + "/crmreports/viewer/viewer.aspx?action=run&context=records&helpID=" + <strong>reportname</strong> + ".rdl&id=%7b" + <strong>reportId</strong>.replace('{', '').replace('}', '') + "%7d&records=%7b" + recordId.replace('{', '').replace('}', '') +  "%7d&recordstype="+<strong>recordtype</strong>+"&p:DisplayType=" + <strong>displayType</strong> + "&p:EntityType=" + entityType;

If you see in the above URL you have your report name and reportId alongwith that you have the recordId against which your report will run (see PreFiltering in CRM 2011). Apart from the these parameters we have the EntityType and DisplayType parameters which are passed as additional parameters probably initialized with some form field values or can be constants values. You need to declare SSSRS Report Parameters by the same name as these query string parameters and they will be automatically populated in the report when your report runs using the above mentioned url.

Hope this helps, let me know if further clarification is needed on the above.

4 thoughts on “CRM 2011 + SSRS Custom Report Passing parameters.

    1. Sayantan Samanta Post author

      Where are you loading the report.
      If inside a IFrame inside the form then you can write javascript to hide it.
      Else if inside the dashboard, then i suggest u create an html page and the write javascript to hide the toolbar.

      Out of the Box there is no way to do it.

      Let me know your scenario and then i can help you further.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s