in Search

Hints, Tips and Tricks

Technical Hints Tips and Tricks that cover customization and development using Sage CRM. API usage and coding are covered.

Editing Report Styles

I have discussed in an earlier article how a report is defined in Meta Data.

One aspect I have not discussed yet it how a report's appearance is defined using Style Sheets.

We have the option to choose the style when we define a report, as we can see from the image below.

 
This style choice is then held in the custom_reports table within the field repo_reportstyle.

The default choices of "Standard with Grids" and "Standard without Grids" are defined in translations (custom_captions) and provide the link to a stylesheet and XSL file.

If we want to add a new custom Style choice for reports we must do the following.

1. Add the Translation (custom_edits)

This has to be:

Caption Family (capt_family) = ReportStyles
Caption Code (capt_code) = CustomStyle
Translation (capt_us) = "Custom Style Sheet"

CustomStyle is the name of my new style sheet choice.

2. We have to create the XSL and CSS files.

The Caption Code "CustomStyles" expects there to be the following files

CustomStylePC.xsl
CustomStyle.css

The XSL file must have a correct LINK to the new css file.



Note: Where reports are to be called from Mobile devices then the following must also be added:
  • CustomStyleCE.xsl
CustomStylePC.xsl is an XSL file.

XSL stands for eXtensible Stylesheet Language which is really a family of transformation languages which explain how XML files are to be formatted or transformed. The CustomStylePC.xsl file is written in XML and uses Extensible Stylesheet Language Transformations (XSLT) to transform the output of the report. XSLT can be used to convert data between different XML schemas or to convert XML data into HTML or XHTML documents for web pages, or into an intermediate XML format that can then be converted to a PDF. This is the reason why Sage CRM reports can be delivered to either a Mobile device, a regular PC browser as HTML, a PDF file or exported to Excel. The original report data doesn't have to change rather when the report is run a new output document is created based on the content of the XSL file.

The XSL file is therefore used to generate the HTML for the report we see below.

 
Note: Unless you are very familiar with editing XSL documents it is recommended that you create your new XSL document by copying an existing one and then only make very minor changes.

CustomStyle.css is a Cascading Style Sheet file

We see the report as a webpage.

 
The need for the XSL file to reference a CSS file is so that the appearance of the HTML output can be further controlled. The CSS file (Cascading Style Sheets) is used to define colours, fonts, layout, and other aspects of the report.

We can see in the image below the areas of the report defined using Class ids.



The CSS file is very easy to edit. I have used a free simple CSS editor from Badsoft called TopStyle Lite.

http://www.newsgator.com/download/products/ts3lite.exe



Note: Just because you can change something doesn't mean you should and unless you have a good eye for design you may want to leave things well alone.

Comments

 

Hints, Tips and Tricks said:

An interesting question came my way a few days ago: Which version of CSS is compatible with Sage CRM

December 8, 2008 11:58
 

Hints, Tips and Tricks said:

You can download Sage CRM 6.2sp1 from the resources section . Editing the Line Item Pages for Quotes

April 20, 2009 8:30
 

Osman said:

Hi there Jeff!

I tried this excercise in my 6.2 d and received this error.

"An error occurred while running the report.

Cannot process the xml input.

System error: -2146697210.

Line 0, Position 0 "

Any idea what may cause this?

Hazlan

November 20, 2009 2:26
 

Osman said:

Ok got it!  The css/xsl files are in the themes.

November 20, 2009 7:46

About Jeff Richards

As the Head of Training Program Development for Sage Technologies, I am responsible for providing the technical education for the Sage CRM Development Partner community. I write and present regularly on Sage CRM development techniques, hints and tips. I also provide education and training for the staff of local Sage companies in new technical features and act as a resource for Sage trainers as they develop their training courses. I have been working with Sage CRM since early 2001 (version 2.85) and I have a thorough understanding of the issues faced by partners carrying out implementations. I have been working within the Software Industry since 1993. I have a strong background in Business Rules and Workflow.

News

To help you find information quickly, use the tag cloud on the righthand side of the page. Every article and file posted is marked with one or more tags. The tags are mainly single words and are listed alphabetically. The more frequently a tag has been used to mark an article the bigger it will appear in the cloud. The tags are hyperlinks that lead to a collection of items that are associated with a tag. To find an article that discusses creating XML feeds using ASP pages, click on ASP, then on the next page click on XML.

This Blog

Syndication

sagecrm.com Articles