To run a report using the ribbon button, you need to create a js file with the function that you will call from your button.
You need 4 things:
- The rdlName file name is rdl.
- reportGuid report GUID.
- entityGuid = GUID of the object for which you are running the report.
- entityType = Entity object type code.
Here is an example.
function printOutOnClick() {
var rdlName = "SomeReport.rdl";
var reportGuid = "9A984A27-34E5-E011-B68F-005056AC478A";
var entityGuid = Xrm.Page.data.entity.getId();
var entityType = "4214";
var link = serverUrl + "/" + organizationName + "/crmreports/viewer/viewer.aspx?action=run&context=records&helpID=" + rdlName + "&id={" + reportGuid + "}&records=" + entityGuid + "&recordstype=" + entityType;
openStdDlg(link, null, 800, 600, true, false, null);
}
openStdDlg () is a wrapper around window.open (). MS Dynamics CRM uses it myself, so I.
, , (CRM 2011) , .