Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

crm online report pdf 404 error

Posted on by Microsoft Employee

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

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: crm online report pdf 404 error

    well while trying in the on-premises(2015)i am getting following error  

    6354.error.PNG

    If i used un-managed  report (without parameter) i am getting this error.but managed report are working fine.

    i haven't tested this in online with un-managed report(only with managed report which gives me 404 failed load resources error.)

    how to rectify this error?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans