Text Scroll

You must welcome, Thank you for visiting my blog.

Search This Blog

Sunday, July 5, 2020

Run SSRS Report on Custom Button Click in MS CRM

function RunCaseTrackingReport() {
    var rdlName = "CaseTracking.rdl"; //Replace
    var reportGuid = "244DE8F6-0774-EA11-A811-000D3AF026B2"; //Replace
    var entityType = "112"; //Replace
    var entityGuid = Xrm.Page.data.entity.getId();  
    var url = Xrm.Page.context.getClientUrl() + "/crmreports/viewer/viewer.aspx?action=run&context=records&helpID=" + rdlName + "&id={" + reportGuid + "}&records=" + entityGuid + "&recordstype=" + entityType ;
    window.open(url, null, 800, 600, true, false, null);
}


-------------------------------OR----------------------------------------------------------

function RunCaseReport() {
    var rdlName = "CaseReport.rdl"; //Replace
    var reportGuid = "564DE8F6-0774-EA11-A811-987D3AF026B2"; //Replace
    var entityType = "112"; //Replace
    var entityGuid = Xrm.Page.data.entity.getId();  
    var url = Xrm.Page.context.getClientUrl() + "/crmreports/viewer/viewer.aspx?action=run&context=records&helpID=" + rdlName + "&id={" + reportGuid + "}&records=" + entityGuid + "&recordstype=" + entityType;
    
var winWidth = Math.floor((window.screen.availWidth) / 2);
var winHeight = Math.floor((window.screen.availHeight) / 3);
var winLeft = Math.floor((window.screen.availWidth - winWidth) / 3);
var winTop = Math.floor((window.screen.availHeight - winHeight) / 4);

var sFeatures = "toolbar=no,menubar=no";
sFeatures += ",width=" + winWidth.toString() + ",height=" + winHeight.toString();
sFeatures += ",left=" + winLeft.toString() + ",top=" + winTop.toString();

window.open(url, null, sFeatures);
}

No comments:

Post a Comment