Sage CRM 2021: Editing the look & feel of Summary Reports and PDF reports.

This article builds on the article "How to customize reports through CSS in PDF format" to further explore how Summary Reports can have their look and feel changed.

Summary Reports are the PDF reports that can be run directly for the Summary Screens of the following entities

  • Companies
  • People
  • Opportunities
  • Cases

They provide a quick overview of information of these system entities.

I have discussed how the content of these reports and the use of charts can be customized in the article "Simple Customization of Summary Reports".

And we can extend Summary Reports to include additional sections as discussed in the article "Extending Summary Reports".

Below is the default appearance of the Summary Report called from the Company Summary Screen.

There are some parts of the report that we can change and other that are hardcoded over which we have no control.

The data and report definitions have to be retrieved from the database. It will create an internal XML document that will be transformed into the finished PDF using internal XLST definitions.

There are a number of steps needed to create the XML document that is the source of the PDF.

1) Firstly all of the sub reports (and the views that they use) that are included in the Summary are identified.

For the default CompanySummary Report these will be

  • Cases
  • Communication
  • Opportunity

2) For each of the sub reports it will then check

  • Does the Report have any search fields defined?
  • What are the Report Bands (sections) included?
  • What fields are included in the report?
  • It then loads the captions/translations for those fields.
  • It then loads the captions/translations for the report title.
  • It then runs the SQL behind the report to fetch the data.

3) It then loads a set of captions/translations that are by the Reports area for captions and messages.

4) Then it loads the metadata for the Header Section of the Summary Report. This is a Screen definition. Fields can be added or removed from this screen. This is always rendered as a two column header. The 'even numbered' fields are displayed in the right hand column.

  • The Custom Content Box is ignored.
  • Create Scripts on Fields are ignored.
  • The field properties like Position, Height & Width are ignored.

5) The data from the for each of the sub reports Communications, Opportunities and Case is then merged together with the summary data into into a master XML file. Most of the structure and styling is hard coded but there are some styling changes that we can make.

Changeable areas

Within the folder

C:\Program Files (x86)\Sage\CRM\CRM\WWWRoot\Themes

Open the file ergonomic.css.

This contains the settings we can change to alter the styling of the PDF reports.

Please note that these will affect all PDF generated reports and not just Summary Reports.

There are 10 areas of the report that can be changed.


You can see how 7 of these area are used in the example report that I generated.

The style sheet C:\Program Files (x86)\Sage\CRM\CRM\WWWRoot\Themes\ergonomic.css is loaded and cached in memory when Sage CRM starts up.

These are very specific settings that can be changed. We can only change the values of the properties, we can not add more properties because this may clash with settings hardcoded with Sage CRM.

But by changing what we can then we can ensure the Summary Reports are closer to our customers requirements

COLUMN_HEADER_STYLE=background-color="#4178be" border-color="#4178be" border-style="solid" border-width="1px" color="white" font-size="8px" font-weight="bold" padding-left="1px" padding-right="1px"
DETAIL_STYLE=border-color="#003349" border-style="solid" border-width="1px" color="#003349" font-size="8px" padding-left="1px" padding-right="1px" text-decoration="none" vertical-align="top"
GROUP_HEADER_STYLE=border-color="#003349" border-style="solid" border-width="1px" color="black" font-size="8px" font-weight="bold" padding-left="1px" padding-right="1px" text-decoration="none" vertical-align="top"
GROUP_FOOTER_STYLE=background-color="white" border-color="#003349" border-style="solid" border-width="1px" color="#003349" font-size="8px" font-weight="bold" padding-left="1px" padding-right="1px"
HEADER_FOOTER_STYLE=background-color="white" color="#A90163" font-size="10px"
SUMMARY_STYLE=background-color="blue" border-color="#003349" border-style="solid" border-width="1px" color="grey" font-size="10px" font-weight="bold" padding-left="1px" padding-right="1px"
TITLE_STYLE=background-color="white" color="#2A3456" font-size="16px" font-weight="normal"
//TITLE_STYLE=background-color="red" color="black" font-size="16px" font-weight="bold"
CAPTION_STYLE=font-size="11px" font-weight="normal" color="#003349"
VALUE_STYLE=background-color="white" font-size="11px" color="#51534A"
MAIN_TITLE_STYLE=background-color="white" color="#2A3456" font-size="16px" font-weight="bold" border-bottom-style="none" border-bottom-width="thin"