Run a report using the ribbon button

I have several custom reports, and I would like to add buttons to the ribbon that runs them.

Is it possible? And if so, then any examples would be great!

Thanks in advance!

+5
source share
2 answers

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() {
    // This function generates a Print out
    var rdlName = "SomeReport.rdl";
    var reportGuid = "9A984A27-34E5-E011-B68F-005056AC478A";
    var entityGuid = Xrm.Page.data.entity.getId();//Here I am getting Entity GUID it from it form
    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) , .

+8

RDL Guid RecordGuid not EntityGuid

+1

All Articles