Creating Custom ASP Reports in Sage CRM.

1 minute read time.

The image below shows that I have just run a custom ASP report called 'TestReport' from within the general category. The report has popped up and has displayed the graph and the panel I wanted.

There are 2 main things to be aware of when creating ASP pages in the reports area.

1) You need a special version of the JavaScript include files that instantiates the COM object. The regular one(s) used in the CustomPages calculate the wrong path so the COM object can not instantiate and would always generate a IIS 500 error.

2) You need to use a special outline page structure for ASP pages in the reports area. This is because you do not want to generate the menu structure and top content for the created page but you still need to make sure that the page follows the theme used in your user interface.

JavaScript include file for ASP Reports

Members of the Developer Program can download the special include file (sagecrmreports.js) from the Example Developer downloads and components folder.

Once the file has been downloaded it needs to be unzipped and placed into the Reports folder.

Copy the file to

  • C:\Program Files (x86)\Sage\CRM\[installname]\WWWRoot\Reports

It then needs to be refenced by an ASP file in one of the sub folders (general, sales etc) using an include statement with a relative path.

Outline Page Structure

Below is the basic outline for an ASP page added to the reports area in Sage CRM.

[code language="javascript"]

<%
var Head = "";
var Body = "";
var EndBody = "";

Response.Write(Head);
Response.Write(Body);

/////////Your Code Starts Here////

///I have assumed that the main block to be executed is called 'myBlock'.

////////You Code Ends Here///////////

Response.Write(myBlock.Execute())

%>
[/code]