Hi everyone,
I developed on SSRS Report and in want to generate PDF on Button Click..!
I am using following JAVASCRIPT to download the PDF
function getReportingSession()
{
var selectedIds = Xrm.Page.data.entity.getId();
var reportName = "ComplaintsAcknowledgementReport.rdl";
var reportGuid = "124AC837-B9D9-E711-812A-005056A068F3";
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=" + reportGuid + "&uniquename=" + Xrm.Page.context.getOrgUniqueName() + "&iscustomreport=true&reportnameonsrs=&reportName=" + reportName + "&isScheduledReport=false&p:parameterNamespecified in ssrs report=" + selectedIds);
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;
}
function runReportToPrint()
{ debugger;
var params = getReportingSession();
var newPth = Xrm.Page.context.getClientUrl() + "/Reserved.ReportViewerWebControl.axd?ReportSession=" + params[0] + "&Culture=1033&CultureOverrides=True&UICulture=1033&UICultureOverrides=True&ReportStack=1&ControlID=" + params[1] + "&OpType=Export&FileName=public&ContentDisposition=OnlyHtmlInline&Format=PDF";
window.open(newPth);
}
i got the following error
Please help me on this .....!
Thanks & Regards,
Sreekanth.
*This post is locked for comments
HI,
when debug what responseText did u get?
Hi,
yes like syed said follow bharat instructions.
=>Create new simple report
=>After try to download your report
Pls follow Bharat instructions step by step, it helps
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156