Hi,
i am working on Dynamics 365 online , i have to download custom report as pdf format on Button click how to achieve this please guide me to do this.
Thanks and Regards,
Iswarya.
*This post is locked for comments
Hi,
i am working on Dynamics 365 online , i have to download custom report as pdf format on Button click how to achieve this please guide me to do this.
Thanks and Regards,
Iswarya.
*This post is locked for comments
Refer below article
docs.microsoft.com/.../exporting-to-microsoft-word-report-builder-and-ssrs
Hi Mohammad Arif,
Thank you for your response.
I want to download the SSRS Report as Word document on button click.
Yes you can download as word. configuration available on SQL reporting server.
Hi Experts,
Can we download the SSRS report as word document(Like PDF)?
Regards,
Seeni
Are you using 9.0 or higher? so you can use QuirksReportViewer to open Reports.
Hi,
which version r u working?? based on version have to change this path
var pth = Xrm.Page.context.getClientUrl() + "/CRMReports/rsviewer/QuirksReportViewer.aspx";
let me know your version, then i will provide correct path
Just open specific report on button click. user can download report as PDF by clicking on inbuilt pdf button.
open report using Script
function OpenReport(){
var url = Xrm.Page.context.getClientUrl() + "/crmreports/viewer/viewer.aspx?action=run&helpID=" + rdlName + "&id={" + reportGuid + "}"
window.open(url, null, 800, 600, true, false, null);
}
click on button PDF file.
Hi,
this is my code
var reportName;
var reportGuid;
function EmailReport() {
try {
debugger
var selectedid = null;
var reportid = null;
var req = new XMLHttpRequest();
var reportName = "Quote Report";
var context = Xrm.Page.context;
var serverUrl = context.getClientUrl();
var ODataPath = serverUrl + "/XRMServices/2011/OrganizationData.svc";
var retrieveResult = new XMLHttpRequest();
retrieveResult.open("GET", ODataPath + "/ReportSet?$select=Name,ReportId&$filter=Name eq'" + reportName + "'", false);
retrieveResult.setRequestHeader("Accept", "application/json");
retrieveResult.setRequestHeader("Content-Type", "application/json; charset=utf-8?");
retrieveResult.send();
if (retrieveResult.readyState == 4 /* complete */) {
if (retrieveResult.status == 200) {
var retrieved = this.parent.JSON.parse(retrieveResult.responseText).d;
var Result = retrieved.results;
if (typeof Result !== "undefined") {
reportid = Result[0].ReportId;
var params = getReportingSession(reportName, reportid);
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=" + reportName + "&ContentDisposition=OnlyHtmlInline&Format=PDF";
window.open(newPth, "_self");
} else {
Xrm.Utility.alertDialog(this.statusText);
}
}
}
} catch (ex) {
throw ex;
}
}
function getReportingSession(reportName, reportGuid) {
debugger;
reportName = "Quote Report";
//reportGuid = "5462c1b7-c0ac-e711-8130-5065f38c1521";
var selectedIds = Xrm.Page.data.entity.getId();
selectedIds = selectedIds.replace('{', '');
selectedIds = selectedIds.replace('}', '');
var pth = Xrm.Page.context.getClientUrl() + "/CRMReports/rsviewer/QuirksReportViewer.aspx";
var retrieveEntityReq = new XMLHttpRequest();
var strParameterXML = "<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'><entity name='quote'><all-attributes /><filter type='and'><condition attribute='quoteid' operator='eq' value='" + selectedIds + "' /> </filter></entity></fetch>";
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&p:CRM_quote=" + strParameterXML);
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;
}
Hi Iswarya,
I too got the same requirement, did you got any solution?
Regards,
sreekanth
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,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156