Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 82002

The report execution repl51vgqoms4g3fjynorp45 has expired or cannot be found.

$
0
0

CRM online Version 1710 (9.1.0.996).

I found this error when i am trying to download fetch xml report from button. it is working on 8.2 version. 


function Download_PDF_Pressupost_Catalan() {

debugger;
var path1 = new Array();
var newPth1;
quoteFetch = "<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'>" +
"<entity name='quote'>" +
"<attribute name='customerid' />" +
"<attribute name='statecode' />" +
"<attribute name='createdon' />" +
"<attribute name='quoteid' />" +
"<attribute name='quotenumber' />" +
"<attribute name='ownerid' />" +
"<attribute name='new_refitineraryid' />" +
"<attribute name='modifiedon' />" +
"<attribute name='modifiedby' />" +
"<attribute name='createdby' />" +
"<attribute name='new_contacto' />" +
"<attribute name='new_pvp' />" +
"<attribute name='new_paxacomp' />" +
"<attribute name='new_pax' />" +
"<attribute name='revisionnumber' />" +
"<attribute name='new_fechasalida' />" +
"<order attribute='createdon' descending='true' />" +
"<order attribute='quotenumber' descending='false' />" +
"<filter type='and'>" +
"<condition attribute='quoteid' operator='eq' value='" + currentQuoteId + "' />" +
"</filter>" +
"</entity>" +
"</fetch>";
var URL = "";
var quoteFetchRecords = XrmServiceToolkit.Soap.Fetch(quoteFetch);
if (quoteFetchRecords.length > 0) {
for (var i = 0; i < quoteFetchRecords.length; i++) {
var RefItenerario = "";
var Cliente = "";
if (quoteFetchRecords[i].attributes["new_refitineraryid"] != undefined) {
RefItenerario = quoteFetchRecords[i].attributes["new_refitineraryid"].name

}
if (quoteFetchRecords[i].attributes["customerid"] != undefined) {
Cliente = quoteFetchRecords[i].attributes["customerid"].name;

}
var Reportname = "";
if (RefItenerario == "") {
Reportname = "Valua Groups";
}
else {
Reportname = "Valua Groups_" + RefItenerario + "_" + Cliente;
}
URL = Reportname.replace(/['.*+?^${}()|[\]\\]/g, " ");

reportID = '32BDF4C1-8F97-E711-8124-E0071B6611E1';
reportName = 'Quote_New1.rdl';
//var pth = Xrm.Page.context.getClientUrl() + "/CRMReports/viewer/Viewer.aspx";

var pth = Xrm.Page.context.getClientUrl() + "/CRMReports/rsviewer/reportviewer.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&p:CRM_quote=" + quoteFetch;

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);
newPth1 = Xrm.Page.context.getClientUrl() + "/Reserved.ReportViewerWebControl.axd?ReportSession=" + ret[0] + "&Culture=1033&CultureOverrides=True&UICulture=1033&UICultureOverrides=True&ReportStack=1&ControlID=" + ret[1] + "&OpType=Export&FileName=" + URL + "&ContentDisposition=OnlyHtmlInline&Format=PDF";
path1[i] = newPth1;
}
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

newPth1 = Xrm.Page.context.getClientUrl() + "/Reserved.ReportViewerWebControl.axd?ReportSession=" + ret[0] + "&Culture=1033&CultureOverrides=True&UICulture=1033&UICultureOverrides=True&ReportStack=1&ControlID=" + ret[1] + "&OpType=Export&FileName=" + URL + "&ContentDisposition=OnlyHtmlInline&Format=PDF";
path1[i] = newPth1;

}
}
}

if (path1.length > 0) {

for (var j = 0; j < path1.length; j++) {
window.open(path1[j]);
}

}

}


Viewing all articles
Browse latest Browse all 82002

Latest Images

Trending Articles



Latest Images