This is a true One-Click to Email report as PDF file, for situations where CRM Users require to frequently Email a report, such as price quotation, as a PDF file. If you know how to create a button for this one click function, all you need is to transfer the report GUID, using below JavaScript and
Replace the GUID of “var repId” in below script with the report GUID, which can be found in the URL when selecting to edit a report (Workplace>Reports>Select Report>Edit)
function AttachPdf() {
var clientUrl = Xrm.Page.context.getClientUrl();
var objectTypeCode = Xrm.Page.context.getQueryStringParameters().etc;
var entityName = Xrm.Page.data.entity.getEntityName();
var entityId = Xrm.Page.data.entity.getId();
var repId = "1F7D2FCE-CEBA-E411-80E2-C4346BAC1E44";
var sendemailurl= clientUrl+ "/WebResources/do_/dp/pdfpreview.html?id=" + repId + "&data="+objectTypeCode+"&data="+entityName+"&data="+entityId+"&data=SE";
window.open(sendemailurl);
}
Dynamics Objects- Innovative Solutions for CRM