JasperReports Server is highly customizable because it's built on the Spring Framework and uses web standards such as Cascading Style Sheets (CSS) and JavaServer Pages (JSP). When the server is embedded in a web application or portal, its user interface (UI) can be customized to extend functionality and better reflect the parent application.
As with any large web application, the logic to generate the JasperReports Server UI is complex and relies on several mechanisms, listed here from simplest to most complex.
|•||SiteMesh – The SiteMesh decorator creates the header and footer for every page of the server. Decorators provide a quick way to edit the overall appearance of the web app, such as branding and copyright.|
|•||Action Model – This provides a simple way to edit any menu in JasperReports Server. The simple XML syntax lets you remove default menu items, restrict their visibility based on roles, and add new menu items if you have implemented an action.|
You can modify themes in a running server and changes will be seen immediately by all users. For all other types of customization, you need to edit the files deployed in the web app. If you're modifying files in the web application, you then need to redeploy the web app in the app server. In some cases, you need to modify source code, in which case you must re-compile the source code and redeploy the web app in the app server.
This chapter includes the following sections:
|•||Changing the UI With Themes|
|•||Customizing the UI With Web App Files|
|•||Customizing the Branding with SiteMesh|
|•||Customizing the Login Page|
|•||Setting the Home Page|
|•||Customizing the Report Rendering Page|
|•||Working With Custom Java Classes|
|•||Adding a Custom JSP Page in a Spring Web Flow|
|•||Adding Custom Export Channels|
The information in this chapter applies to JasperReports Server 4.7 and later. For previous versions of the server, refer to the corresponding version of the JasperReports Server Ultimate Guide.
The set of files in the default theme was updated in 4.7. Custom themes developed prior to 4.7 may require upgrading to work with the new set of files. For more information see the upgrade procedures in the JasperReports Server Installation Guide.
This chapter assumes you're proficient with CSS and with J2EE application development and configuration.
Some of the changes described here are cosmetic, but others affect the core behavior of the server. Use extreme caution when making the described edits, because inadvertent changes might cause JasperReports Server to fail. We recommend that you make all customizations in an isolated test environment before applying them in your production environment.