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:
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.