View Sage CRM Reports in PDF format from any Sage CRM screen

By | October 30, 2014

In our previous posts on Sage CRM reports, we had explained how to,
1) Get impressive reports by adjusting Report Styles in Sage CRM
2) Get impressive PDF Reports by adjusting Report Styles in Sage CRM – Part 2
3) Include your Company Logo in Sage CRM Reports
GUMU Sage CRM Integrations : Sage ERP X3 | Sage 100 | Sage 500 | Sage 300
New Stuff:
 Sage CRM builder – Future of Sage CRM Cloud

In this blog post, we will explain how to view the Sage CRM reports in PDF format from any Sage CRM screen. Consider an example where you want to run a report that shows Case Stage by Company (which is available in Reports section and its Report ID is 15 when it is checked through SQL) from Cases tab of My CRM.
1) Add a button in Sage CRM using Button Groups. For that purpose, login to Sage CRM and navigate to Administration | Advanced Customization | Button Groups.
2) Click on New button and fill details as shown in below screenshot.
3) Then Reports button Group will be added to Button Groups list. Click on the Reports Button Group and fill details as mentioned below.
Caption: Run Report
Action: customurl
Url Name: JavaScript:OpenReport();
4) Click on Add button and then click on Save button.
5) With this, Run Report button will be added to Cases tab of My CRM. Refer below screenshot.
6) Add below script into the Custom Content Section.
function OpenReport()
var strPath = document.URL;
var arrayApp = strPath.split(“/Do?”);
var iReportID = 15
var iReportAction = 1411;
//Allowed values for strDestination are “Screen”, “Adobe”, “CSV”, “Excel”
var strDestination = “Adobe”;
var strURL = arrayApp[0] +”/Do?SID=”+GetKeyFromURL(“SID”)+”&Act=”;
strURL += iReportAction+GetKeys()+”&Key41=”+iReportID+”;
strURL += “&FlgNewWindow=True&Destination=”
strURL += strDestination+”&PageSize=210×297&Orientation=Landscape”;, ‘Report’ , ‘toolbar=0 , scrollbars=0, location=0, statusbar=0, menubar=0 ,resizable=0, width=600, height=400, left = 340, top = 200’);
function GetKeyFromURL(name)
var winURL =;
var queryStringArray = winURL.split(“?”);
var queryStringParamArray = queryStringArray[1].split(“&”);
var nameValue = null;
for(var i=0; i<queryStringParamArray.length; i++)
queryStringNameValueArray = queryStringParamArray[i].split(“=”);
if(name == queryStringNameValueArray[0])
nameValue = queryStringNameValueArray[1];
return nameValue;
8) Click on Save button.
Now just navigate to Cases tab of My CRM and on click of this button, you will see that the report will be generated in PDF format. Refer below screenshot.
With these steps, you can run any report which is created in Reports section in PDF format from any Sage CRM screen. This can be further customized as per requirements.
Also Read:
1) Generating simple reports in Sage CRM
2) Steps to generate complex reports in Sage CRM using Advanced Find
3) Showing images in Sage CRM Reports
4) Opening TCP-IP port to access SLX Web Reports from outside network
5) Historical Reports – Opportunity Closing History