View source | Discuss this page | Page history | Printable version   

Reporting Server/Jasper Report Template Customization


When a user creates a report from an Ad-Hoc view it is possible to select a template to set style information and header and footer. Openbravo delivers a set of standard templates which you can use as the starting point for a custom template.

To use the standard templates with a custom logo you only need to upload a new logo in the following folder: /System/resources.

Jasper template custom logo.png

Creating a new template

To create a custom template several steps are required:

We will discuss each of these steps separately.

Custom jrxml file

An example template can be found File:OBReportingTemplate A4 portrait.jrxml. The template consists of two parts, a section for styling and to show a header/title and footer.

The example template file refers to a logo image file. In your customization you can also use images, make sure to store them in the referenced location in the Jasper Server repository.

When you are finished with the jrxml file you have to upload it to a specific location in the jasper server: /Public/Templates, as a jrxml file.

Jasper upload as jrxml.png

Use the template when generating a report

You can use the template in the adhoc view by saving the adhoc view as a report. In the popup there is a field Custom Report Template where you can select your template.

Jasper use template.png

Default template

To change the default template used when creating a report from ad-hoc view you have to edit the WEB-INF/applicationContext-adhoc.xml file. Set the defaultTemplateUri value to a path to the jrxml file you uploaded into the repository.

<util:map id="reportGeneratorDefaultConf">
    <entry key="templatesFolderUri" value="/public/System/Templates"/>
    <entry key="defaultTemplateUri" value="/public/System/Templates/OBReportingTemplate_A4_landscape.jrxml"/>
    <entry key="publicFolderUri" value="#{configurationBean.publicFolderUri}"/>

Advanced Topic

An advanced topic which can be added to a template is to show the parameters used to generate the reports. This is not delivered in our standard product, so if there is a requirement for this feature it needs to be developed. The following File:Show file contains a sample template and java files which are needed. The java code needs to be compiled to class files and placed on the jasper server.

Retrieved from ""

This page has been accessed 4,193 times. This page was last modified on 8 December 2019, at 12:47. Content is available under Creative Commons Attribution-ShareAlike 2.5 Spain License.