When i try to download pdf file from report using js it shows me 404 error in crm online. This is the code i been using ,
var reportName ="AccountOverview.rdl";
function getReportingSession(reportID) {
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");
rptPathString = "id=%7B" + reportID + "%7D&uniquename=" + Xrm.Page.context.getOrgUniqueName() + "&iscustomreport=true&reportnameonsrs=&reportName=" +
reportName + "&isScheduledReport=false";
retrieveEntityReq.send(rptPathString);
var x = retrieveEntityReq.responseText.indexOf("ReportSession=");
var y = retrieveEntityReq.responseText.indexOf("ControlID=");
var ret = new Array();
if (retrieveEntityReq.responseText.indexOf("&", x) != -1 && retrieveEntityReq.responseText.indexOf("&", y) != -1) {
ret[0] = retrieveEntityReq.responseText.substr(x + 14, retrieveEntityReq.responseText.indexOf("&", x) - x - 14);
ret[1] = retrieveEntityReq.responseText.substr(y + 10, retrieveEntityReq.responseText.indexOf("&", y) - y - 10);
}
else if (retrieveEntityReq.responseText.indexOf("\\u0026", x) != -1 && retrieveEntityReq.responseText.indexOf("\\u0026", y) != -1) {
ret[0] = retrieveEntityReq.responseText.substr(x + 14, retrieveEntityReq.responseText.indexOf("\\u0026", x) - x - 14); //the session id
ret[1] = retrieveEntityReq.responseText.substr(y + 10, retrieveEntityReq.responseText.indexOf("\\u0026", y) - y - 10); //the control id
}
return ret;
}
And what is the description of "CRMReports/rsviewer/QuirksReportViewer.aspx" url ,i wouldn't find detail regarding this?
*This post is locked for comments