Hello,
I am new to Dynamics 365. I am trying to execute ssrs report on quote given by default using javascript. But I am unable to get response. I am getting value of index of ReportSession as -1 and ControlId as -1. When I checked response it is showing an error occured. Below is my code for getting report session.
function getReportingSession() { var selectedIds = Xrm.Page.data.entity.getId(); var reportName = "Quote.rdl"; var reportGuid = "54f73f63-eec9-e711-8134-c4346bdcdf71"; //OR Report GUID - Replace with your report GUID var pth = Xrm.Page.context.getClientUrl() + "/CRMReports/rsviewer/QuirksReportViewer.aspx"; var retrieveEntityReq = new XMLHttpRequest(); retrieveEntityReq.open("POST", pth, false); retrieveEntityReq.setRequestHeader("Accept", "*/*"); retrieveEntityReq.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); retrieveEntityReq.send("id=%7B" + reportGuid + "%7D&uniquename=" + Xrm.Page.context.getOrgUniqueName() + "&iscustomreport=true&reportnameonsrs=&reportName=" + reportName + "&isScheduledReport=false"); var x = retrieveEntityReq.responseText.lastIndexOf("ReportSession="); var y = retrieveEntityReq.responseText.lastIndexOf("ControlID="); var ret = new Array(); ret[0] = retrieveEntityReq.responseText.substr(x + 14, 24); ret[1] = retrieveEntityReq.responseText.substr(x + 10, 32); return ret; }
Please help.
Thanks in advance.
*This post is locked for comments