Jasper Upgrade PDF

Download as pdf or txt
Download as pdf or txt
You are on page 1of 194

JASPERREPORTS SERVER ADMINISTRATOR GUIDE

RELEASE 5.0

http://www.jaspersoft.com

JasperReports Server Administrator Guide Copyright 2012 Jaspersoft Corporation. All rights reserved. Printed in the U.S.A. Jaspersoft, the Jaspersoft logo, Jaspersoft iReport Designer, JasperReports Library, JasperReports Server, Jaspersoft OLAP, and Jaspersoft ETL are trademarks and/or registered trademarks of Jaspersoft Corporation in the United States and in jurisdictions throughout the world. All other company and product names are or may be trade names or trademarks of their respective owners. This is version 1112-JSP50-15 of the JasperReports Server Administrator Guide.

Table of Contents

TABLE OF CONTENTS
Chapter 1 Overview of JasperReports Server Administration . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1.1 Overview of Organizations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 1.1.1 1.1.2 1.1.3 1.2 1.2.1 1.2.2 1.2.3 1.2.4 1.3 1.3.1 1.3.2 1.4 1.4.1 1.4.2 1.5 1.5.1 1.5.2 1.6 Single Default Organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 Multiple Organizations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 Levels of Administrators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 Folder Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 Sample Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 Browsing and Searching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 Administering Users and Roles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 Delegated Administration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 Authentication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 Authorization Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 JasperReports Server Heartbeat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 Administrator Email . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

Overview of the Repository . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

Overview of Users and Roles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

Overview of Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

Administrator Login . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

Administrator Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

Chapter 2 Organization, User, and Role Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21


2.1 Managing Organizations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.2 2.2.1 Viewing Organization Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 Creating an Organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 Default Folders for Organizations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 Editing an Organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 Deleting an Organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 Viewing User Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

Managing Users . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

JasperReports Server Administrator Guide 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 2.3 2.3.1 2.3.2 2.3.3 2.3.4 Creating a User . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 Editing a User . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 Editing Profile Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 Enabling or Disabling Users in Bulk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 Deleting One or More Users . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 Viewing Role Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 Creating a Role . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 Assigning Users to a Role . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 Deleting One or More Roles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34

Managing Roles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30

Chapter 3 Repository Administration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35


3.1 3.2 Resource Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 JasperReport Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 3.2.1 3.2.2 3.2.3 3.2.4 3.3 3.3.1 3.3.2 3.3.3 3.3.4 3.3.5 3.3.6 3.3.7 3.4 3.4.1 3.4.2 3.4.3 3.4.4 3.5 3.5.1 3.5.2 3.5.3 3.5.4 3.5.5 3.5.6 3.5.7 Referencing Resources in the Repository . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 Absolute References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 Local Resources and External References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 Data Snapshots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 Resource IDs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 Creating Folders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 Adding Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 Renaming Folders and Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 Copying and Moving . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 Editing Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 Deleting Folders and Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 Organization Folders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 Design Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 Referencing Resources in the Repository . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 Best Practices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 Inheriting Permissions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 Cumulative Permissions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 Administrator Permissions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 Execute-Only Permission . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 Default User Permissions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 Setting Permissions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 Testing User Permissions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50

Managing Folders and Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39

Multiple Organizations in the Repository . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45

Permissions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46

Chapter 4 Resources in the Repository . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53


4.1 Data Sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 4.1.1 4.1.2 4.1.3 4.1.4 4 JDBC Data Sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 JNDI Data Sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 Hadoop-Hive Data Sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 MongoDB Data Sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59

Table of Contents 4.1.5 4.1.6 4.2 4.3 Virtual Data Sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 Bean Data Sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63

Queries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 Input Controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 4.3.1 4.3.2 4.3.3 Datatypes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 Lists of Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 Creating an Input Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 Creating a Query-based Input Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 Built-in Parameters for Query-based Input Controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 Domain-based Queries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76 Cascading Input Controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 Fonts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 JAR Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 Resource Bundles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 Creating a File Resource . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 Editing a File Resource . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83

4.4

Query-based Input Controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 4.4.1 4.4.2 4.4.3 4.4.4

4.5

File Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 4.5.1 4.5.2 4.5.3 4.5.4 4.5.5

Chapter 5 Themes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
5.1 5.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 How Themes Work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 5.2.1 5.2.2 5.2.3 5.3 5.3.1 5.3.2 5.3.3 5.3.4 5.4 5.4.1 5.4.2 5.4.3 5.4.4 5.4.5 Theme Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 Inheritance Mechanism . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 CSS Priority Scheme and Custom Overrides . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 Setting the System Theme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90 Setting an Organization Theme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91 Restricting Access to Themes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92 Creating Theme Folders and Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 Theme Development Workflow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 Firebug Plug-in for Firefox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96 Test Platform . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96 Modifying the Appearance of Jaspersoft OLAP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97 User Interface Samples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97

Administering Themes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90

Working With CSS Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95

Chapter 6 Import/Export . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
6.1 6.2 6.3 6.4 6.5 6.6 Import and Export Catalogs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99 Exporting from the User Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100 Importing from the User Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101 Command-Line Utilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 Exporting From the Command Line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 Importing From the Command Line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104

JasperReports Server Administrator Guide

Chapter 7 System Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107


7.1 7.2 Configuration Settings in the User Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108 Configuring User Password Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110 7.2.1 7.2.2 7.3 7.4 7.5 7.6 Enabling Password Expiration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110 Allowing Users to Change their Passwords . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111

Configuring the User Session Timeout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111 Configuring Password Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112 Encrypting the Repository Database Password . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112 Encrypting User Session Login . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113 7.6.1 7.6.2 Dynamic Key Encryption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114 Static Key Encryption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114

7.7 7.8

Configuring CSRF Prevention . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 Configuring Input Validation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 7.8.1 7.8.2 7.8.3 7.8.4 Customizing Security Error Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116 Configuring Input Validation Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117 Query Validation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119 Further Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119

7.9

Defining a Cross-Domain Policy for Flash . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120 7.10.1 7.10.2 7.10.3 7.10.4 Ad Hoc Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121 Ad Hoc Editor Configuration File Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124 Managing the Ad Hoc Cache . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124 Configuring Ad Hoc OLAP Filters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128

7.10 Configuring Ad Hoc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121

7.11 Enabling Data Snapshots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128 7.12 Configuring System Logs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129 7.12.1 7.12.2 Managing Log Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130 Log Configuration Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132

7.13 Disabling the Domain Validation Check . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133 7.14 Configuring JasperReports Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134 7.14.1 7.14.2 7.14.3 7.14.4 7.14.5 Extending JasperReports Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134 Changing the Crosstab Limit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134 Setting a Global Chart Theme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135 Enabling the XHTML or HTML Exporter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135 Enabling Flash or HTML5 for Pro Charts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136

7.15 Configuring the Heartbeat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136 7.16 Removing Report Scheduling Interval Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137 7.17 Special Domain Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137 7.17.1 7.17.2 7.17.3 Enabling Oracle Synonyms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138 Enabling CLOB Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138 Enabling Proprietary Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139

7.18 Configuring the Online Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140

Chapter 8 Server Diagnostics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141


8.1 Events Being Audited and Monitored . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142

Table of Contents 8.2 Configuring Auditing and Monitoring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143 8.2.1 8.2.2 8.2.3 8.3 8.3.1 8.3.2 8.4 8.4.1 8.4.2 8.5 8.6 8.7 Enabling Auditing and Monitoring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143 Auditing Archive Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144 Events and Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144 Domain Items . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146 Audit Reports and Ad Hoc Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147 Domain Items . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148 Monitoring Views and Reports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149

Using the Audit Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145

Using the Monitoring Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148

Importing and Exporting Event Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150 Real-Time Diagnostics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150 Exposing Diagnostics Through Jaspersofts JMX Agent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151 8.7.1 8.7.2 8.7.3 8.7.4 8.7.5 Connecting to the JMX Agent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151 Configuring the Port and Connection Name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151 Configuring Roles for JMX Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152 Disabling Remote Connections to the JMX Agent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152 Alternative Connection Through App Server JMX Service . . . . . . . . . . . . . . . . . . . . . . . . . 152

8.8 8.9

Using the Diagnostic Data In Reports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153 Excluding Diagnostic Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154

Appendix A Troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155


A.1 A.2 A.3 A.4 Number of Users Exceeded . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155 Field Names Disappear in Ad Hoc Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155 Scheduler Sending Multiple Emails . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156 Adding Data Sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156 A.4.1 A.4.2 A.4.3 A.4.4 A.4.5 A.4.6 A.4.7 JDBC Driver in Classpath . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156 JDBC Driver Name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156 Database Permissions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157 JDBC Database URL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157 JNDI Services on Apache Tomcat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157 JNDI Services on JBoss . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158 JNDI Services on WebLogic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158

Appendix B Integrating With Liferay Portal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159


B.1 B.2 B.3 B.4 B.5 B.6 B.7 B.8 B.9 Changing Liferays Port Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159 Configuring JasperReports Server to Accept Web Services Calls . . . . . . . . . . . . . . . . . . . . . . . . . . . 160 Configuring Liferay to Access JasperReports Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161 Setting the Portal Organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161 Testing Liferay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161 Deploying the JasperReports Server Portlet WAR File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162 Configuring a Default Report to Display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162 Input Controls in the Portlet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163 Testing the JasperReports Server Portlet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163

B.10 JasperReports Server Portlet Configuration Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163 7

JasperReports Server Administrator Guide B.11 Setting up JasperReports Library Hyperlinks for Use in a Portlet . . . . . . . . . . . . . . . . . . . . . . . . . . . 165

Appendix C Localization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167


C.1 C.2 Configuring JasperReports Server for the Default Multi-byte Fonts . . . . . . . . . . . . . . . . . . . . . . . . . . 167 UTF-8 Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167 C.2.1 C.2.2 C.2.3 C.2.4 C.2.5 C.3 C.3.1 C.3.2 C.3.3 C.4 C.4.1 C.4.2 C.4.3 C.5 C.5.1 C.5.2 Tomcat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168 JBoss . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168 PostgreSQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168 MySQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169 Oracle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169 About Properties Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170 Creating a Resource Bundle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171 Changing Format Masks and Date Formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172 Specifying Additional Locales . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174 Specifying Additional Time Zones . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175 Setting a Default Time Zone . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175 Changing Character Encoding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176 Working with Fonts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177

Creating a Locale . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170

Configuring JasperReports Server to Offer a Locale . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174

Character Encoding and Fonts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176

Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181 Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189

Overview of JasperReports Server Administration

CHAPTER 1

OVERVIEW OF JASPERREPORTS SERVER ADMINISTRATION

JasperReports Server builds on JasperReports Library as a comprehensive family of Business Intelligence (BI) products, providing robust static and interactive reporting, report server, and data analysis capabilities. These capabilities are available as either stand-alone products, or as part of an integrated end-to-end BI suite utilizing common metadata and providing shared services, such as security, a repository, and scheduling. The heart of the Jaspersoft BI Suite is the server, which provides the ability to:

Easily view and explore your data in the web-based drag-and-drop Ad Hoc Editor interface. Efficiently and securely manage many reports. Interact with reports, including sorting, filtering, formatting, entering parameters and drilling on data. Arrange reports and web content to create appealing, data-rich Jaspersoft Dashboards that quickly convey business trends.

Jaspersoft OLAP is an optional component of JasperReports Server, controlled by licence and described in its own user guide. While the Ad Hoc Editor lets users create simple reports, more complex reports can be created outside of the server. You can use Jaspersoft iReport Designer (hereafter called iReport) or write your own JRXML code to create a report that can be run in the server. Jaspersoft recommends that you use iReport unless you have a thorough understanding of the JasperReports Library file structure. See the JasperReports Server User Guide for more information. Jaspersoft provides several other source of information to help extend your knowledge of JasperReports Server:

Our Ultimate Guides document advanced features, best practices, and numerous examples. The guides are available as PDFs for purchase in the Jaspersoft online store. Commercial customers can download them freely in the support portal. Our free Business Intelligence Tutorials let you learn at your own pace, and cover topics for developers, administrators, business users, and data integrators. The tutorials are available online in the Professional Services section of our website.

Our free samples, which are installed with JasperReports Library, iReport, and JasperReports Server, are documented online. The samples documentation can be found on our community website.
This administrator guide describes features that are only available to users who have administrator roles. Many of the configuration procedures also assume you have unlimited access to the JasperReports Server host computer.

This chapter contains the following sections:


Overview of Organizations Overview of the Repository Overview of Users and Roles Overview of Security Administrator Login Administrator Pages

JasperReports Server Administrator Guide


This section describes functionality that can be restricted by the software license for JasperReports Server. If you dont see some of the options described in this section, your license may prohibit you from using them. To find out what you're licensed to use, or to upgrade your license, contact Jaspersoft.

JasperReports Server is a component of both a community project and commercial offerings. Each integrates the standard features such as security, scheduling, a web services interface, and much more for running and sharing reports. Commercial editions provide additional features, including Ad Hoc charts, flash charts, dashboards, Domains, auditing, and a multiorganization architecture for hosting large BI deployments

1.1

Overview of Organizations

The architecture of the commercial version of JasperReports Server is built on organizations, which are logical entities within JasperReports Server that have their own users, roles, and branches of the repository. As with any business structure or hierarchy, organizations may have suborganizations, which in turn may have suborganizations, and so on. In the default JasperReports Server installation, there is a single organization that mimics the simple structure of older versions of JasperReports Server. If you want to deploy multiple organizations, there are certain design considerations you must be aware of. ***Note that organizations are not available in the community version of JasperReports Server.

1.1.1

Single Default Organization

After a default installation, JasperReports Server contains a single organization in which you can deploy your reports. For example, if you install the sample data, you see a single organization that holds all sample resources, users, and roles. Single organizations are designed to handle most business cases and are straightforward to administer. Even in a single organization, there is a system admin and an organization admin that share administrative duties. If the needs of your business call for more organizations, you must manage several levels of administrators and possibly create shared resources in the repository. The following sections provide use cases and explain the functioning of multiple levels of administrators.

1.1.2

Multiple Organizations

There are many scenarios for defining multiple organizations in JasperReports Server. For instance: An application provider, such as a software-as-a-service (SaaS) company or a computer department, has a hosted application being offered to many customers. It integrates JasperReports Server in its application in order to offer dashboards, reports, and analysis. There are a number of common reports and data sources that are useful across customers, but there are customer specific reports, as well. Machines and databases are shared by customers, according to the providers own architecture, but within the functionality provided by JasperReports Server, each customer is a separate organization. Customers can manage their own users in the hosted application, and JasperReports Server maps the applications authentication scheme to the correct organization. The organization mechanism provides the full power of JasperReports Server to each of the providers customers, while ensuring that their data and reports are secure. A company has many departments but wants to consolidate the BI environment so that all departments are sharing a common BI infrastructure. Corporate IT only needs to deploy and maintain a single instance of JasperReports Server, and each department is represented by an organization that manages its own users. For security and simplicity, the departments do not share databases, except in the case of sub-departments, such as Accounts Payable being a subdepartment of Finance. Users access JasperReports Server directly, logging in with their department name and user name. Organization administrators have defined the data sources and Domains specific to the needs of their departments users.

The organization feature is flexible enough to accommodate any combination of these scenarios and many like it. In all cases, administrators can configure secure environments for any number of organizations, and end-users experience a powerful BI platform that is tailored to their needs. Each organization or hierarchy of organizations co-exists independently in the same instance of JasperReports Server, which isolates neighboring organizations from each other but allows parent organizations to have full control over their suborganizations. Users may access only the data and resources in their organization or a suborganization, and administrators may define roles and set permissions to further restrict access. 10

Overview of JasperReports Server Administration

1.1.3

Levels of Administrators

Each organization has an administrator who can manage users, roles, and repository permissions in that organization. The administration of organizations is hierarchical, meaning that the administrator can also manage all users and roles in suborganizations of any level. There are essentially three levels of administration:

The system administrator Also called system admin. The ID of the system admin is superuser. He exists at the root level, outside all organizations. The system admin manages the JasperReports Server installation, creates top-level organizations, and configures server-wide settings. The system admin can create, modify, and delete users, roles, and repository objects of any organization. The administrator of a top-level organization Also called organization admin. The organization admin manages all users, roles, and repository objects in an entire organization, including any suborganizations. The default login name of the organization admin is jasperadmin. The administrator of a suborganization Functionally equivalent to an organization admin, but due to the hierarchy of organizations, manages a limited set of user, roles, and repository objects and may be overridden by a top-level organization admin.

The most important distinction is between the system admin and organization admin. Even in the case of a single default organization, there is a system admin for server settings, and an organization admin for the single organization. The system admin can manage all users and the entire repository, but sometimes it is more convenient to use the organization admin to do this because the organization admin sees the repository in the same way as the organization users. When there are suborganizations, the administrator of the parent organization can either manage their users and roles, or delegate those tasks to an administrator in each suborganization. The administrator of a suborganization is limited to accessing resources and managing users and roles in the suborganization, thereby maintaining the security of the parent organization and any of the parents other suborganizations.

1.2

Overview of the Repository

The repository is a hierarchical structure of folders where JasperReports Server, administrators, and users store resources for creating, running, and viewing reports. In its appearance and function, the repository resembles a file system with a structure of folders containing files. However, the repository is actually implemented as a database that is private to the server instance. As a result, it lacks a few of the functions of a file system.

1.2.1

Folder Structure

The root of the repository tree structure is accessible only to the system admin logged in as superuser (Figure 1-1) in the commercial edition, or jasperadmin in the community edition. The tree contains the folders for each organization (in the commercial edition), and folders for certain configuration settings.

Figure 1-1

Root of the Repository Showing Default Folders

11

JasperReports Server Administrator Guide In the repository, each organization has its own branch, contained in a folder named after the organization. Each organizations top-level folder also contains a folder called Organizations so that suborganizations can be created. Figure 1-1 shows the superusers view, starting at root. In the Organizations folder there is a folder for the default organization, which is named Organization. This figure also shows a second top-level organization. Commercial edition users logged in as jasperadmin will see a similar structure. JasperReports Server automatically restricts every users access to their own organizations branch of the repository. System admins (superuser) can view and create folders in all organizations, while organization admins (jasperadmin) can only view and create folders in the organizations they administer. In general, Jaspersoft recommends that you avoid placing resources directly in the root or organization folder. Instead, use folders for various resource types, as in the sample data.

1.2.2

Resources

Resources are stored in the repository and used as input for creating reports and performing analysis. Some resources, such as images, fonts, or JRXML files created in iReport, are uploaded from files. Others, such as data sources and Domains, are created in JasperReports Server itself. Of course, dashboards, view, and reports can also be saved in the repository to be run as often as needed, and output such as PDF or HTML can be saved in the repository as well. All resources, including folders, have a unique ID, a name, and an optional description. The ID of a resource, along with the ID of its enclosing folders creates a path that can be used to reference resources. The name and description appear in the user interface when browser or searching the repository. Resources are stored in an internal format that is not accessible to users or administrators, although certain objects can be downloaded to your file system in an output format such as XML. Any resource may be exported with the js-export utility, but the resulting files are for backup or transfer to another JasperReports Server instance and cannot be modified. JasperReports Server restricts access to folders and resources based on organizations, user names, and roles. The system admin and organization admin can define permissions as explained in section 1.3, Overview of Users and Roles, on page 14.

1.2.3

Sample Data

When you install the sample data in JasperReports Server, the default organization (Organization) has sample content. Figure 1-2 shows the folders containing the sample resources, as seen by the system admin and default organization admin.

12

Overview of JasperReports Server Administration


System admin (superuser) view: Organization admin (jasperadmin) view:

Figure 1-2

System Admin and Organization Admin Views of Sample Data

The sample data includes dashboards, reports, Domains, data sources, and many of their components, such as input types and image files. Each type of content is stored in a separate folder, making it easy to locate. The Supermart Demo folder contains a complete example of dashboards, reports, and resources for various business scenarios in a fictional grocery store company. The Public folder is a special system folder that appears at the root and in every organization folder. Its contents are shared with all organizations. The system admin should manage the Public folder and set permissions so that users can access shared resources (such as data sources, logos, and report templates) but not modify them.

1.2.4

Browsing and Searching

Users and administrators can browse or search the repository, depending on what action they want to perform and how resources are organized. In many cases, such as when you are editing permissions, you can use either mode, but sometimes only one mode displays the features and commands you need, such as when you copy an object.

13

JasperReports Server Administrator Guide

Browse - On the Home page, click View > Repository.

Figure 1-3

Browsing the Repository

In Browse mode, the Folders panel on the left lists the folders in the repository and the Repository panel lists the contents of the selected folder. The tool bar in the Repository panel allows you to perform actions such as Copy, Cut, Paste, and Delete; select several resources in a same folder to perform actions in bulk. Search mode does not have the tool bar.

Search - Enter a search term in the search field at the top of any page, or select View > Search Results.

Figure 1-4

Searching the Repository

The filters in the left-hand panel allow users to refine their search. The View > Reports and View > OLAP Views also use the search feature with preset filters to find all reports and all OLAP views to which the user has access. For more information on browsing and searching the repository, see the JasperReports Server User Guide.

1.3

Overview of Users and Roles

User accounts and role membership provide authentication and authorization mechanisms to implement access control in JasperReports Server. Users enter an organization name if required, a login name, and a password in order to access

14

Overview of JasperReports Server Administration JasperReports Server. Administrators assign named roles to users and then create role-based permissions to further restrict access to objects in the repository and to data in Domains. In the commercial version of JasperReports Server, both users and roles are associated with the organizations in which they are defined, and they follow the same hierarchical model. Users and roles defined in an organization may be granted or denied access to any repository folder or object in the organization or its suborganizations. However, the administrator of the suborganization has no visibility of the roles and users in the parent organization, even if they are used in access permission within the suborganization. User names and role names are unique within an organization, but not necessarily among suborganizations or across all organizations in the server. For example, the default organization administrator is called jasperadmin in every organization. Because the organization must be given when logging in, JasperReports Server can distinguish between every user. In some cases such as web services, a user is identified by the unique string username|organization_ID. In the community edition of JasperReports Server, there is only a single default organization. All user and role names belong to this organization. Access to the repository is defined directly on the repository resources. Administrators may define a level of access, such as read-write, read-only or no access, and each permission may be based either on a user name or on a role name.

1.3.1

Administering Users and Roles

Administrators perform the following actions to manage users in their organization: Create, modify, and delete users. Set user account properties such as name, email, and setting the password. However, no administrator can ever view a users existing password in clear text. Login as any user in the organization to test permissions. Create, modify, and delete roles. Assign roles to users. Set access permissions on repository folders and resources.

1.3.2

Delegated Administration

JasperReports Server enables three levels of delegated administration: The hierarchical structure of organizations means administrators in each organization are limited to actions within their organization. But this only applies to multiple organizations where it makes sense to have subordinate administrators. The Administer permissions allows a user to view and set permissions on a folder or resource. This allows a power-user to manage her own section of the repository, but not to create or manage users. Granting ROLE_ADMINISTRATOR, ROLE_SUPERUSER, or both allows a user to see the management interface and create users and roles. This is true delegated administration, whereby a user other than superuser or jasperadmin has the same abilities.

In the case of true delegated administration, there are three factors that determine the scope of a users administrative privileges:

ROLE_ADMINISTRATOR JasperReports Server confers the organization-level privileges to any user with this role. This includes managing users, roles, and permissions in the repository, as well as creating resources in the repository. When a user with this role logs in, the server displays the additional menus to access the admin pages and manage repository resources. Any administrator, who by definition has this role, can assign it to any other user. ROLE_SUPERUSER When a user already has ROLE_ADMINISTRATOR, this additional role grants access to the system configuration functions. Only a system admin can assign this role to another user; organization admins cannot see or assign this role.

In a multi-organization environment, ROLE_SUPERUSER should not be given to organization admins or organization users, because this allows access to the Ad Hoc cache shared by all organizations. In the case of a single organization such as in the default installation, you may assign this role to the organization admins to grant access to system settings without granting privileges to create top-level organizations or other system administrators.

15

JasperReports Server Administrator Guide

The users organization Regardless of roles, an administrator is always limited in scope to the organization in which the user account is created, including any suborganizations thereof. In no case can a user, even with the ROLE_SUPERUSER, ever view or modify any organization, user, role, or folder outside of the organization to which the user belongs.

Any administrator can grant ROLE_ADMINISTRATOR to any user. That user then becomes equivalent to an organization admin of the organization in which he belongs. In order to delegate system administration, the existing system admin must first create other users at the root level, outside of any organization. The system admin can then assign both ROLE_ADMINISTRATOR and ROLE_SUPERUSER to grant them system admin privileges. For further information about these roles, see section 3.5, Permissions, on page 46.

1.4

Overview of Security

JasperReports Server ensures that people can only access the data they are allowed to see. The mechanisms that define organizations, users, roles, and repository resources work together to provide complete access control that includes:

Authentication Restricts access to identified users and protects that access with passwords. Defines roles for grouping users and assigning permissions. Authentication is further explained in the next section. Authorization Controls access to repository objects, pages, and menus based on users and roles. Authorization is further explained in a following section. Data level security (commercial version only) Defines row and column level permissions to access your data. Row and column level permissions can be defined and enforced in Domains. For more information, refer to the JasperReports Server User Guide. If you implement Jaspersoft OLAP, you can use roles to secure your data at any level of an analysis schemas hierarchy. For more information, refer to the Jaspersoft OLAP User Guide.

Administrators must keep security in mind at all times when managing organizations, user, roles, and resources, because the security mechanism behind each of these rely on the others.

1.4.1

Authentication

The first part of security is to define user accounts and secure them with passwords. Users must log in with their user ID and password so that they have an identity in JasperReports Server. The server stores user definitions, including encrypted passwords, in a private database. Administrators create, modify, and delete user accounts through the administrator pages, as described in section 2.2, Managing Users, on page 25. JasperReports Server also implements roles that can be assigned to any number of users. Roles let administrators create groups or classes of users that are granted similar permissions. A user may belong to any number of roles and receive the privileges from each of them. The server stores role definition in its private database, and administrators create, modify, and delete roles through the administrator pages, as described in section 2.3, Managing Roles, on page 30. JasperReports Server relies on the open source Spring security framework; it has many configurable options for:

External authentication services such as LDAP (used by Microsoft Active Directory and Novell eDirectory) Single sign-on using JA-SIG's Central Authentication Service (CAS) Java Authentication and Authorization Service (JAAS) Container security (Tomcat, Jetty) SiteMinder Anonymous user access (disabled by default) HTTPS, including requiring HTTPS HTTP Basic HTTP Digest X509

JasperReports Server also supports these encryption and authentication standards:


The Spring framework is readily extensible to integrate with custom and commercial authentication services and transports. Authentication occurs by default through the web user interface, forcing login, and/or through HTTP Basic authentication for web services, such as Jaspersoft iReport Designer and for XML/A traffic. The server can automatically synchronize with an 16

Overview of JasperReports Server Administration external authentication service. The external users dont need to be created manually in the server first. Both users and roles are created automatically in the server from their definitions in an external authentication service. For an overview of the authentication system and details about external authentication, see the JasperReports Server Authentication Cookbook.

1.4.2

Authorization Overview
The menus that appear in JasperReports Server depend on the users roles. For example, only users with the administrator role can see the Manage menu and access the administrator pages. By modifying the servers configuration, you can modify access to menus, menu items, and individual pages. Refer to the JasperReports Server Source Build Guide and JasperReports Server Ultimate Guide for more information. Users belong to organizations and are restricted to seeing resources within their organization. Organizations have their own administrators, but they see only the users, roles, and resources from their organization. When JasperReports Server is configured with multiple organizations, they are effectively isolated from each other, although the system admin can share resources through the Public folder. For more information, see section 3.4, Multiple Organizations in the Repository, on page 45. Administrators can define access permissions on every folder and resource in the repository. Permissions can be defined for every role and every user, or they can be left undefined so they are inherited from the parent folder. For example, user may have read-write access to a folder where they create reports, but the administrator can also create shared reports in the same folder that are set to read-only. The possible permissions are: no access, execute only, read-only, read-delete, read-write-delete, and administer (see section 3.5, Permissions, on page 46). Permissions are enforced when accessing any resource either directly through the repository interface, indirectly when called from a report, or programmatically through the web services. Permissions are cumulative, meaning that a user has the most permissive access that is granted to any of the roles to which the user belongs.

With a users identity and roles established, JasperReports Server controls the users access in these ways:
Menu options and pages

Organization scope

Resource permissions

Administrator privileges

JasperReports Server distinguishes between reading or writing a resource in the repository and viewing or editing the internal definition of a resource. For security purposes, granting a user read or write permission on a resource does not allow viewing or editing the resource definition. For example, users need execute or read permission on a data source to run reports that use it, but they cannot view the data sources definition which includes a database password. Also, only administrators may interact with theme folders to upload, download, and activate CSS files that control the user interface. Data-level security defines what data can be retrieved and viewed in a report, based on the username and roles of the user who runs the report. For example, a management report could allow any user to see the management hierarchy, managers would see the salary information for their direct employees, and only human resource managers would see all salary values. Data-level security in Domains is explained in the JasperReports Server User Guide. Datalevel security through OLAP views is covered in the Jaspersoft OLAP User Guide. Note: This type of security is only available in the commercial edition of JasperReports Server.

Data-level security

Profile attributes

A profile attribute is a name-value pair inserted in the database record of a user object, such as a user account or role. Profile attributes may then be referenced in data-level security definitions to provide additional security. Profile attributes can be added only by database administrators. For information on defining profile attributes, see the JasperReports Server Ultimate Guide.

17

JasperReports Server Administrator Guide

1.5

Administrator Login

Administrators log in on the standard login page, using the following default passwords: System admin: Commercial edition: username superuser and password superuser Community edition: username jasperadmin and password jasperadmin Organization admin: username jasperadmin and password jasperadmin
For security reasons, always change the default administrator passwords immediately after installing JasperReports Server. For instructions, see section 2.2.3, Editing a User, on page 27.

For more information about options on the Login page and logging in with multiple organizations, see the JasperReports Server User Guide. The first time you log in as an administrator, you may be prompted to opt-into the Heartbeat program. You should also set the administrator passwords and email.

1.5.1

JasperReports Server Heartbeat

When you login to JasperReports Server for the first time after installation, users of the commercial edition may be prompted to opt into the servers Heartbeat program. It reports specific information to Jaspersoft about your implementation: the operating system, JVM, application server, RDBMS (type and version), and JasperReports Server edition and version number. By tracking this information, Jaspersoft can build better products that function optimally in your environment. No personal information is collected. To opt into the program, click OK. To opt out, clear the check box then click OK.

1.5.2

Administrator Email

After logging in for the first time, you should set the email on the superuser and jasperadmin accounts to your email address. In very rare cases, the server may notify you by email about issues with your license.
This is also a good time to change the default passwords on the superuser and jasperadmin accounts as well.

To set the email and passwords on the administrator accounts, edit the user account information as described in section 2.2.3, Editing a User, on page 27.

1.6

Administrator Pages

Administrators have access to special pages to manage the server. After logging in, click the large Manage Server button on the Getting Started page or select an item from the Manage menu on any page.
System admin: Organization admin:

Figure 1-5

Different Manage Menus for Different Admins

In the commercial edition of JasperReports Server, the administrator controls are different for system and organization admins, as shown in Figure 1-5. Organization administrators can manage users, roles, and suborganizations, but only within their 18

Overview of JasperReports Server Administration organization. System admins can manage top-level organizations, as well as users and roles in any organization. In addition, only system admins have access to the server-wide settings that apply to logs, Jaspersoft OLAP, and Ad Hoc cache and data policies. Figure 1-6 shows the Manage Server page for system admins that includes the OLAP Settings button not available to organization admins.

Figure 1-6

Manage Server Page for System Admins in Commercial Editions (superuser)

Figure 1-7 shows the dialog that appears when you click the About JasperReports Server link in the footer of all pages. The dialog displays the product version number. It also shows the software build, your license type, and its expiration. Please have this information if you need to contact Jaspersoft for support.

Figure 1-7

About JasperReports Server Dialog

19

JasperReports Server Administrator Guide

20

Organization, User, and Role Management

CHAPTER 2

ORGANIZATION, USER, AND ROLE MANAGEMENT

This section describes functionality that can be restricted by the software license for JasperReports Server. If you dont see some of the options described in this section, your license may prohibit you from using them. To find out what you're licensed to use, or to upgrade your license, contact Jaspersoft.

In a single-organization deployment, the administrator only needs to create the users and roles. In deployments with multiple organizations, administrators need to create organizations, populate them with users, and create the roles that they use afterwards to set access permissions. In a deployment with multiple organizations, there can be administrators at every level of the hierarchy, as described in section 1.3.2, Delegated Administration, on page 15. Part of any large deployment is to designate the administrators who are responsible for every task. For example, system administrators might set up the top-level organizations and default roles, but each organizations admin would then create and manage the users of their particular organization. The interface in JasperReports Server for managing organizations (commercial edition users), users, and roles (both commercial and community editions) accommodates all levels of administrators and makes it easy for them to search among hundreds of users and roles, whether in a single organization or spread across many. The interface also enforces the scope of administrative privileges. For example, it insures that an organization administrator cannot see roles and users from parent organizations. This chapter contains the following sections:

Managing Organizations Managing Users Managing Roles

2.1

Managing Organizations

System admins and organization admins use the same pages for managing organizations, the only difference is that system admins can manage top-level organizations, whereas organization admins are limited to suborganizations.
Community edition users, and administrators of deployments with a default single organization can generally skip this section. However, this procedure can be used to change the name of the default organization.

Figure 2-1 shows the organizations that the system admin/superuser can view, that is, all the organizations in the repository. As shown in the Organizations panel on the left, the system admins view begins at the root of the organization hierarchy and

21

JasperReports Server Administrator Guide includes all defined organizations and suborganizations, so he can manage any organization or suborganization in the repository. In this example, there are two top-level organizations, and one of them has several suborganizations.

Figure 2-1

System Admin View of Manage Organizations Page

Figure 2-2 shows the same repository as seen by the admin of Organization. It shows that this admins view is limited to his own organization and its suborganizations, and he can access and manage only those.

Figure 2-2

Organization Admin View of Manage Organizations Page

2.1.1
1. 2. 3.

Viewing Organization Properties

Log in as a user with administrative privileges for the organization. Select Manage > Organizations. The organization management page appears, as shown in Figure 2-1 or Figure 2-2. To select an organization, click its parent in the left-hand Organizations panel, then select it in the center Organization panel. If there are many organizations, you can enter a search term to find a specific organization. However, the search term only searches the list of organization in the center Organizations panel. Once an organization is selected, the Properties panel shows information about the organization:

4.

Name Display name of the organization that appears on the organizations top folder.

22

Organization, User, and Role Management


ID Unique and permanent ID of the organization that is used for logging into the organization. Alias Unique but editable short name for the organization that can also be used when logging in. Description Optional description that only appears in this Properties panel. Number of Users Count of all users, including those in any suborganizations. Click Manage to see the list of users on the user management page. Number of Roles Counts all roles, including those in any suborganizations. The number of roles does not include the system roles (such as ROLE_USER) that appear at every organization level but are defined at the root level. Click Manage to see the list of roles on the role management page.

2.1.2
1. 2. 3. 4.

Creating an Organization

Log in as a user with administrative privileges for the parent of the new organization. Click Manage > Organizations. In the left-hand Organizations panel, expand the hierarchy of organizations to select the parent organization, for example Finance, then click Add Organization in the middle panel. The Add Organization dialog appears.

Figure 2-3 5. 6.

Adding an Organization

Enter the organization name; the server automatically fills in the ID and alias based on the name. You can change the ID and alias if you needed. The Description is optional. Figure 2-3 shows sample values. To save the new organization, click Add Organization to <organization>. The new organization appears in the Organizations panels. When you select it in the center panel, its properties appear in the Properties panel on the right.

The properties panel shows the number of users and roles in the organization and links to manage them. By default, new organizations have the following:

Two users with default passwords: the organization admin (jasperadmin/jasperadmin) and a sample user (joeuser/
joeuser). For security reasons, always change the default passwords immediately after creating a new organization. For instructions, see section 2.2, Managing Users, on page 25.

The organization has no roles of its own. The default users have the system-wide roles ROLE_USER and ROLE_ADMINISTRATOR. There is a folder created in the repository, under the parents Organization folder. The new organization folder contains a copy of the parents Organization/Folder Template folder. To manage the Organization folders, select View > Repository. 23

JasperReports Server Administrator Guide

2.1.3

Default Folders for Organizations

Every organization contains a special folder named Organizations where suborganizations are created. The Organizations folder always contains a folder named Folder Template. When a new organization is created, the entire contents of the Folder Template is copied to create the new organizations folders. Admins can add folders and resources in Folder Template, and these are also copied when additional organizations are created. The default folders in the Folder Template are:

Ad Hoc Components\Topics The location where the Ad Hoc Editor looks for Topics to create new reports. Temp A folder visible only administrators, used by the server to store temporary files. Themes A special folder managed by the system to contain CSS files that define the user interface.
The Public folder visible in every organization is a special shared folder at the root level. The repository makes it accessible to every organization, but it is not within the organization folder.

There is a Folder Template at every level of the organization hierarchy, including the root. The system admin can add content to the top-level Folder Template for use in creating top-level organizations. Organization admins can add content to their respective Folder Template for use in creating suborganizations. Finally, the Folder Template itself is copied into a new organization, so new suborganizations have the same default folders and resources as their parent.

2.1.4
1. 2. 3. 4.

Editing an Organization

Log in as a user with administrative privileges for the organization. Click Manage > Organizations. In the left-hand Organizations panels, select the organizations parent. In the center Organizations panel, select the organization. In the right-hand Properties panel, click Edit. The fields in the organizations Properties panel become editable.

Figure 2-4 5.

Editing Properties of an Organization

Change the organization properties as needed. Changing the organization name changes the name of the organizations folder, as well, but no other data. The organization ID cannot be changed; it always has the value defined when the organization is created. The alias and description can be changed. Click Save to keep your changes, or Cancel to quit without saving.

6.

24

Organization, User, and Role Management

2.1.5
1. 2. 3. 4.

Deleting an Organization

Log in as a user with administrative privileges for the organization. Click Manage > Organizations. In the left-hand Organizations panels, select the organizations parent. In the center Organizations panel, select the organization. In center Organizations panel, click Delete. Administrators cannot delete the organization to which they belong. Confirming the delete completely removes all users, roles, and folders of the organization and all of its suborganizations from JasperReports Server.

2.2

Managing Users

As with organizations, system admins can manage all users in all organizations, as well as create users outside of organizations, as described in section 1.3.2, Delegated Administration, on page 15. Organization admins can manage only the users in the organizations they administer. The default installation of JasperReports Server contains the following users: Table 2-1 User Name
superuser anonymousUser jasperadmin joeuser demo CaliforniaUser

Default Users in JasperReports Server Installations Default Password*


superuser anonymoususer jasperadmin joeuser demo CaliforniaUser

Organization
none none Organization Organization Organization Organization

Description
Default system admin (commercial edition only). Allows anonymous login; disabled by default. Default organization admin in every organization. Default end user in every organization. Included for use with sample data. Included for use with sample data.

* Passwords are case-sensitive.

You should advise your users to change their passwords regularly. To configure periodic expiration of their passwords, refer to section 7.2, Configuring User Password Options, on page 110.

2.2.1
1. 2.

Viewing User Properties

Log in as a user with administrative privileges for the users organization. Select Manage > Users or, on the Admin Home page, click Users. As shown in Figure 2-5, the Manage Users page displays the users in each organization and properties for the selected user.

25

JasperReports Server Administrator Guide

Figure 2-5

Manage Users Page

The list of users includes everyone in the chosen organization and its suborganizations. The same user ID may appear more than once in the Users panel, indicating that users with the same ID were created in different organizations. The third column gives the organization name of a particular user. In this example, the system admin can see all users in all organizations by selecting the root of the Organization hierarchy. There are always multiple jasperadmin users in a hierarchy of organizations, because it is the default administrator ID in each organization that is created. 3. To locate a user:

To browse for users, expand the organization hierarchy in the left-hand panel, and select an organization. Scroll through the list of users, or choose a suborganization to reduce the list. To search for a specific user, select the organization (or any parent organization) and enter a search string in the Search field of the Users panel. The search results show all users in the selected organization and suborganizations whose username contains the search string. If necessary, scroll through the results or refine your search. To stop the search, click

4.

Select the user in the Users panel. The users properties appear in the Properties panel. The properties include the users name, user ID, email address, assigned roles, user status, and profile attributes. User status can be Enabled or Disabled; disabled users are displayed in gray text in the list of users. Profile attributes are special user attributes that are added directly in the database, not through this Manage Users page (see JasperReports Server Ultimate Guide). For convenience, the role names link to the role management page for each role.
As the admin of a given organization, you can see the roles defined in your organization and its suborganizations but not the parent organization (except for certain system-wide roles). A user may have roles defined and assigned from a parent organization that are not visible to the administrator of the users organization. For more information, see section 2.3, Managing Roles, on page 30.

2.2.2
1. 2.

Creating a User

Log in as a user with administrative privileges for the organization to which the user will belong. Select Manage > Users or, on the Admin Home page, click Users.

26

Organization, User, and Role Management 3. In the Organizations panels, select the organization to which the user will belong, then click Add User. For community edition admins, simply click Add User. The Add User dialog appears.

Figure 2-6 4.

Adding a User

Enter the following information:

User name The full name of the person associated with the user account. The name is optional but recommended; it can be in any format or convention. JasperReports Server always displays the current users name in the top righthand corner of the screen. User ID Generated automatically from the user name; you can accept the suggested value or type your own. The user ID is used to log into JasperReports Server, and for administrators to manage users and resources. User IDs must be unique within an organization, but may exist in other organizations. Email The email address of the person. The email is optional but the address must be in a valid format. Password and confirmation Enter the same password in both fields. User is enabled Select the checkbox to enable the user right away. Users that are not enabled cannot log in. If you implement role-based permissions, you might want to delay enabling the user until you assign more roles. For more information on roles, see section 2.3, Managing Roles, on page 30.

5.

Click Add User to <organization> (Add User for community edition users) to create the user. The new user appears in the Users panel, unless you entered a search term that excludes it. If you want to assign roles to the user, click Edit in the Properties panel of the new user, as shown in the following section.

2.2.3

Editing a User

One way to assign roles is to add available roles to a given user. Alternatively, when you edit roles, you can assign any number of users to a given role. 1. 2. 3. 4. Log in as a user with administrative privileges for the users organization. Click Manage > Users or, on the Admin Home page, click Users. In the Organizations panel, select the users organization. (Commercial users only. Community users skip to step 4.) The Users panel refreshes to display the users in the selected organization, including all children organizations. In the Users panel, select the user. The information for chosen user account is displayed in the Properties panel.

27

JasperReports Server Administrator Guide 5. In the Properties panel, click Edit.

Figure 2-7 6.

Editing the Properties of a User

Modify the user name, email, password, and enabled status as needed. You cannot edit the user ID or the profile attributes. The user ID always has the value defined when the user is created originally; the profile attributes can only be modified in the database (see the JasperReports Server Ultimate Guide).

7.

To assign or remove roles from the user, select the roles, and click the arrow buttons between the Roles Available and Roles Assigned lists. The Roles Available list includes any role in the organizations of the current administrator, as well as the special systemwide roles. For more information on creating and adding roles, see section 2.3, Managing Roles, on page 30.

8. 9.

Click Save to keep your changes, or Cancel to quit editing without saving. In the Properties panel, click Login as User to test the users permissions, as explained in section 3.5.7, Testing User Permissions, on page 50. Logging in as another user is also necessary when you are maintaining resources that use absolute references in the repository. For more information, see section 3.4.3, Referencing Resources in the Repository, on page 45.

2.2.4

Editing Profile Attributes

Profile attributes are name-value pairs associated with a user account. They can provide additional information about the user, and they can also be used to restrict access to data through Domain security files and OLAP schemas. As of version 5.0, JasperReports Server provides a user interface to easily add, edit, and remove profile attributes from user accounts. Jaspersoft recommends using this interface instead of accessing the private repository database, as was required previously.
To add, edit, or remove profile attributes:

1. 2. 3. 28

Log in as a user with administrative privileges for the users organization. Click Manage > Users or, on the Admin Home page, click Users. In the Organizations panel, select the users organization. (Commercial users only. Community users skip to step 4.)

Organization, User, and Role Management The Users panel refreshes to display the users in the selected organization, including all children organizations. 4. 5. In the Users panel, select the user. The information for chosen user account is displayed in the Properties panel. In the Properties panel, click Edit and select the Attributes tab at the top of the panel.

Figure 2-8 6.

Editing the Attributes of a User

To create a new attribute, enter an attribute name, an attribute value and click Add. Attributes may have multiple values specified as a comma-separated list in the value field. You cannot add two attributes with the same name.

7. 8. 9.

To remove an existing attribute, click Remove in the corresponding row. To edit an attribute, remove it and create it again with the desired value. Click Save. The new attributes appear in a table in the users Properties panel.

Figure 2-9

Viewing the Attributes of a User

29

JasperReports Server Administrator Guide

2.2.5

Enabling or Disabling Users in Bulk

Administrators sometimes need to prevent users from logging in by disabling the user accounts. For example, when performing configuration changes, you may want to lock out all users until the changes are finished. Bulk operations let administrators select any number of users, and superuser can select all users in the server, except himself. 1. 2. 3. 4. 5. Log in as a user with administrative privileges for the users organization. Click Manage > Users or, on the Admin Home page, click Users. In the Organizations panel, select the users organization; to enable or disable users in different organizations, select the common parent organization. In the list of users, select all the users to enable or disable. Use Control-click and Shift-click to make multiple selections. If the list of users is too long, enter a search term to find users and enable or disable them individually. Click Enable or Disable in the menu bar.

2.2.6
1. 2. 3. 4. 5.

Deleting One or More Users

Log in as a user with administrative privileges for the users organization. Click Manage > Users or, on the Admin Home page, click Users. In the Organizations panel, select the users organization; to delete multiple users in different organizations, select the common parent organization. In the list of users, select the user to delete. Use Control-click and Shift-click to make multiple selections. If the list of users is too long, enter a search term to find and select the user. In the tool bar of the Users panel, click Delete and confirm the action.

2.3

Managing Roles

Roles define sets of users who are granted similar permissions. Administrators create roles, assigned them to users, and set permissions in the repository (see section 3.5, Permissions, on page 46). By default, JasperReports Server includes the following roles; some are needed for system operation, some are included as part of the sample data: Table 2-2 Role
ROLE_SUPERUSER

Default Roles in JasperReports Server Installations Description


Commercial editions only. This role determines system admin privileges, as explained in section 1.3.2, Delegated Administration, on page 15. It is a system-level role, however the system admin may assign it to organization admins in single-organization deployments. Never delete this role, it is required for proper administration of the server. This role determines organization admin privileges, as explained in section 1.3.2, Delegated Administration, on page 15. JasperReports Server automatically assigns this role to the default jasperadmin user in every new organization. It is a special system-level role that is visible in every organization and which organization admins may assign to other users. Never delete this role, it is required for proper administration of the server. Every user that logs into JasperReports Server must have this role. The server automatically assigns this role to every user that is created, and it is required to log in. It is a special system-level role that is visible in every organization. Never delete this role, it is required to create users and allow them to log in. When anonymous access is enabled, JasperReports Server automatically assigns this role to any agent accessing the server without logging in. It is a special system-level role that is visible in every organization. This role is also assigned to the default anonymous user. By default, anonymous access is disabled and this role isnt used. If you do not allow anonymous access, this role can be deleted.

ROLE_ADMINISTRATOR

ROLE_USER

ROLE_ANONYMOUS

30

Organization, User, and Role Management Table 2-2 Role


ROLE_PORTLET

Default Roles in JasperReports Server Installations, continued Description


JasperReports Server assigns this role to users that are created automatically when a portal such as Liferay requests authentication for a connection. If the specified user name does not exist in the server, it is created, assigned the password of the user in the portal, and assigned the ROLE_PORTLET and ROLE_USER roles. If you do not use a portal server, this role can be deleted. This role grants access to the SuperMart demo Home page, reports, and if you implement Jaspersoft OLAP, OLAP views. This role is assigned to the demo user in the default organization. These objects are available only if you installed the sample data when you installed JasperReports Server. It is a special system-level role that is visible in every organization When you no longer need the sample data, this role can be deleted. This role is used to assign permissions relative to the sample data. It is a special system-level role that is visible in every organization. It demonstrates data security features available in Jaspersoft OLAP. See the Jaspersoft OLAP Ultimate Guide for more information. When you no longer need the sample data, this role can be deleted. This role no longer governs any JasperReports Server permissions or functionality, unless your server is integrated with Talend Integration Suite Enterprise Edition (TIS EE). Otherwise, it does not appear in the server.

ROLE_DEMO

ROLE_SUPERMART_MANAGER

ROLE_ETL_ADMIN

Except for the five special system-level roles visible in every organization, roles are defined within organizations. The same role ID can be defined in separate organizations, as long as it is unique within each organization. Admins can manage all roles in their organizations and any suborganization, but they can never see roles in a parent or sibling organization. JasperReports Server enforces this scheme to ensure that organizations are secure and only valid roles are assigned to users. It is possible for an administrator to assign a role to a user in a suborganization, where the role is defined in a parent organization of the user. The admin of the users organization cannot see the role when managing the user, but the admin of the roles organization can, and permissions associated with the role are properly enforced.

2.3.1
1. 2.

Viewing Role Properties

Log in as a user with administrative privileges for the roles organization. Community users log in as any user with administrative privileges. Select Manage > Roles or, on the Admin Home page, click Roles. As shown in Figure 2-10, the Manage Roles page displays the roles in each organization and properties for each role.

31

JasperReports Server Administrator Guide

Figure 2-10

Manage Roles Page

The list of roles includes all roles in the chosen organization and its suborganizations. The list of roles also includes the five default system-level roles. The same role name may appear more than once, indicating that roles with the same name were created in different organizations. The second column (blank in this figure) gives the organization name of a particular role. In this example, the system admin can see all roles in all organizations by selecting the root of the Organization hierarchy. 3. To select a role, click its organization in the Organizations panel. (Commercial users only. Community users skip to step 4.) The Roles panel is displayed. 4. Click the role in the Roles panel. To filter the list of roles, enter a search string in the Search field of the Roles panel. The search results show all of the roles in the selected organization and suborganizations whose name contains the search string. If necessary, scroll through the new list or refine your search. To stop the search, click 5. Select the role in the Roles panel. The roles properties appear in the Properties panel. The Properties panel shows the role name, the organization where it is defined, and the list of users to whom the role has been assigned. The list of users shows only their user IDs, but hovering over an ID displays a tooltip with the full name and organization, as shown in Figure 2-10.
When you view the properties of the special system-level roles, you only see the users with this role in your organization or any suborganization. An organization admin can never see users outside of his organization or its suborganizations.

2.3.2
1. 2. 3. 4.

Creating a Role

Log in as a user with administrative privileges for the organization in which the role will be used. Select Manage > Roles or, on the Admin Home page, click Roles. In the Organizations panels, select the organization to which the role will belong. (Commercial users only. Community users skip to step 4.) Click Add Role. The Add Role dialog appears.

32

Organization, User, and Role Management

Figure 2-11 5. 6.

Adding a Role

Enter the name of the role. Roles have no other properties or settings. Click Add Role to <organization> (Add Role for community edition users) to create the role. The new role appears in the Roles panel, unless you entered a search term that excludes it. If you want to assign users to the role, click Edit in the Properties panel of the new role, as shown in the following section.

2.3.3

Assigning Users to a Role

The management interface for roles lets you assign multiple users to one role. To assign multiple roles to a single user, edit the users properties with the procedure in section 2.2.3, Editing a User, on page 27. 1. 2. 3. 4. Log in as a user with administrative privileges for the organization in which the role is defined. Select Manage > Roles or, on the Admin Home page, click Roles. In the Organizations panels, select the roles organization. (Commercial users only. Community users skip to step 4.) The Roles panel is displayed. Select the role in the Roles panel.
Unless you are logged in as the system admin, you cannot edit or delete the five special system-level roles.

5.

In the Properties panel, click Edit. The roles properties become editable. You can change the role name and the users assigned to it.

Figure 2-12 6.

Editing the Members of a Role

Enter a different name to change the role name throughout the server.

33

JasperReports Server Administrator Guide


Permissions in the repository that use the role name are automatically updated. However, role names in security files for Domains and OLAP are not updated with the new role name and may cause a security risk. If you use security files for Domains or OLAP, do not change role names without verifying the files as well. For more information, see the JasperReports Server User Guide.

7. 8.

To assign or remove users from the role, select the users, and click the arrow buttons between the Users Available and Users Assigned lists. Click Save to keep your changes, or Cancel to quit without saving.

2.3.4
1. 2. 3. 4.

Deleting One or More Roles

Log in as a user with administrative privileges for the organization in which the role is defined. Select Manage > Roles or, on the Admin Home page, click Roles. In the Organizations panels, select the roles organization. (Commercial users only. Community users skip to step 4.) The Roles panel is displayed. Select the role in the Roles panel. Use Control-click and Shift-click to make multiple selections.
Unless you are logged in as the system admin, you cannot edit or delete the five special system-level roles.

5.

In the tool bar of the Roles panel, click Delete and confirm the action.

34

Repository Administration

CHAPTER 3

REPOSITORY ADMINISTRATION

This section describes functionality that can be restricted by the software license for JasperReports Server. If you dont see some of the options described in this section, your license may prohibit you from using them. To find out what you're licensed to use, or to upgrade your license, contact Jaspersoft.

JasperReports Server provides a powerful and flexible environment for deploying and running JasperReports. The repository stores all the resources used to run and create reports, including data source definitions, JRXML files, datatypes, and helper files such as images. Administrators create the folders and resources so that users can create, run, and save the reports they need. For administrators who want to customize the user interface, the repository also holds the CSS and image files that define a theme. The repository is structured as a hierarchy of folders that is based on the hierarchy of organizations. The JasperReports Server web interface enables you to browse the repositorys resources, manage its folder structure, and secure its contents. This chapter covers the basic tasks of administering the repository, including:

Creating folders and organizing repository objects. Managing references to data sources, images, fonts, and other resources upon which reports rely. Controlling access to resources in the repository through roles and object-level permissions. Section 1.2, Overview of the Repository, on page 11 explains the basic structure and navigation of the repository. Chapter 4, Resources in the Repository, on page 53 describes the resources that administrators create for reports. Chapter 5, Themes, on page 85 describes how special CSS and image files in the repository define the user interface.

Further information about the repository is covered in the following sections:


You can also access the repository programmatically by using the web services and APIs. For more information on these features, refer to the JasperReports Server Web Services Guide and to the JasperReports Server Ultimate Guide, respectively. This chapter contains the following sections:

Resource Types JasperReport Structure Managing Folders and Resources Multiple Organizations in the Repository Permissions

35

JasperReports Server Administrator Guide

3.1

Resource Types

Resources in the repository have a type that determines how users can interact with it. The various resource types are based on various reports and report elements that users and administrators store in the repository. There are two fundamental types of resources: those that the end user creates, and those that the administrator must create. End users create the following resources. Procedures for end users to create these resources are described in the JasperReports Server User Guide: Table 3-1 Resources Created by End Users Description
Professional edition only. Created interactively in the Ad Hoc Editor by dragging and dropping columns of data onto a table, chart, or crosstab. Users may then explore their data by applying filters and performing pivot operations. An Ad Hoc view can also be saved as an interactive report and shared with other users. Professional edition only. A collection of reports, input controls, graphics, labels, and web content displayed together. Users create dashboards interactively in the Dashboard Designer and save them in the repository. Report output of any format, either from running a report in the background or from scheduling a report. A content resource is a simple file that the repository allows users to view or download. A complex type that combines a JRXML file, a data source, and optional components such as input controls to define a report that users can run in the server. Depending on the usage scenario, both users and administrators create JasperReports in the server. For more information, see section 3.2, JasperReport Structure, on page 37. Optionally, reports may also store a snapshot of the report data to improve performance when many users access the same reports. Professional edition only. Reports with input controls allow you to save combinations of input data so that you can run a custom version of the report directly. In the repository, report versions are always listed under the original report.

Resource Type
Ad Hoc views

Dashboard

Content resource

JasperReport or simply report

Report version

The other types of resources are all created and managed in the repository by administrators. The following resources generally support the creation of reports Table 3-2 Resources Created by Administrators Description
A connection that points to a database or other data store. Data sources define where data is stored for running reports. There are several types of data sources, based on the type of connection or location of the data: JDBC, JNDI, and bean data sources. For more information, see section 4.1, Data Sources, on page 53. A basic type that defines the format for input values, for example text, number, or date. A datatype may also specify a valid range for the input value. A metadata layer that selects, joins, and filters tables and fields from your data and lets you give them user-friendly labels. A Domain can be the basis for an Ad Hoc report. Domains also support row-level security and localization of labels. Domains are further documented in the JasperReports Server User Guide. A resource that stores a file in the repository. Table 4-2, File Resource Types, on page 81 gives the list of supported file formats and their purpose. A complex type that specifies what values users can input for a report and how the input field appears when running the report, for example radio buttons or check boxes. Input controls depend on datatypes or lists of values to specify the format of the input.

Resource Type
Data source

Datatype Domain

File Input Control

36

Repository Administration Table 3-2 Resources Created by Administrators, continued Description


A basic type that defines a list of arbitrary labels for input. Each label is associated with a value that can correspond to your data. For example, the Month Names List in the sample data associates the name of each month with the values 1 to 12. A database query string, for example in SQL. The JRXML doesnt necessarily include the query, in which case, you must define a query resource for use in the JasperReport.

Resource Type
List of Values

Query

Administrators may also manage OLAP resources in the repository, if their license supports Jaspersoft OLAP. For more information about OLAP and Mondrian resources, see the Jaspersoft OLAP User Guide. Table 3-3 OLAP Resources Created by Administrators Description
A server-side XMLA source definition of a remote client-side XML/A connection. Defines how to retrieve data for an OLAP view. An OLAP client connection is either a direct Java connection (Mondrian connection) or an XML-based API connection (XML/A connection). If you implement Jaspersoft OLAP, a view of multidimensional data that is based on an OLAP client connection and an MDX query. Like JasperReports, they are collections of individual resources that define how to access and present the data.

Resource Type
Mondrian XML/A Source OLAP Client Connection

OLAP View

3.2

JasperReport Structure

The resource in the repository that aggregates all information needed to run a report is called a JasperReport. A JasperReport is based on a JRXML file that conforms to the JasperReports open source library that the server uses to render reports. A JasperReport is a complex resource that is composed of other resources:

A JRXML file that defines the report, called the main JRXML. A data source that supplies data for the report. A query if none is specified in the main JRXML. The query may specify its own data source, which overrides the data source defined in the report. Input controls for any parameters that users may enter before running the report. Input controls are composed of either: A datatype definition A list of values Any additional file resources, such as images, fonts, and resource bundles referenced by the report template. If the report includes sub-reports, the JRXML files for the subreports.

The collection of all the resources that are referenced in a JasperReport is sometimes called a report unit. End users usually see and interact with a JasperReport as a single resource in the repository, but report creators must define all of the component resources.

3.2.1

Referencing Resources in the Repository

There are several ways to define and reference all the resources in a JasperReport. In environments that rely directly on JasperReports, shared resources are usually stored on a network file system accessible to all developers and users. This solution is sometimes impractical, as you cannot always add such resources to the classpath, and the use of absolute paths has its own limitations. In addition, storing the resources in the file system discourages their reuse: your developers may invest time in creating new versions of resources that already exist because they dont know about them.

37

JasperReports Server Administrator Guide By storing resources in the repository, JasperReports Server makes it easy and reliable to share resources such as images, style templates, and subreports between reports. In order to share resources, reports must reference resources with a special syntax. To reference resources in the repository, use a URI with the repo: prefix in your JRXML. This is similar to the file: syntax for file-based resources and the http: syntax that is used for web-based resources, however it is recognized only inside of JasperReports Server. When you use this syntax in your JRXML files, you can store all your resources in well-known locations in the repository. This simplifies the process of uploading your reports, because you dont have to upload the resources each time. Also, you can manage these resources either through iReport, through the JasperReports Server user interface, or through the servers APIs. For example, when you update a logo image resource, all reports that reference the resource also display the new logo. The following sections describe several ways of using the repo: syntax to create different kinds of references.

3.2.2

Absolute References

Absolute references are URIs in the JRXML of the report that specify a resources complete repository path. The following example references an image named myImage that is stored in the /images folder:
repo:/images/myImage

The path must start with a / to represent the root of the repository, and is composed of the resource ID of every parent folder, ending with the ID of the resource. iReport with the JasperReports Server plug-in supports absolute references by allowing you to drag resources from the repository tree view into the design area.
If you implement organizations, the absolute path is relative the users organization, as described in section 3.4, Multiple Organizations in the Repository, on page 45.

When uploading the JRXML with absolute resource references as part of a JasperReport in the server, you only need to ensure that the resource with the given path exists in the repository before running the report. When the report runs, the server locates the resource in the repository and uses it to render the report. Because file resources such as images, fonts, and JARs are the only resources for which you can create references directly in JRXML, they are the only resources for which you can create absolute references. One disadvantage of absolute references is that JasperReports Server does not maintain the dependency between the JRXML and the absolute reference. When uploading the JRXML, there is no warning if the resource does not exist, and the server allows you to delete the resource from the repository even if it is still being referenced. If the resource is not available, running the report fails with an error.

3.2.3

Local Resources and External References

JasperReports Server provides more flexibility and power when you use indirect references instead of absolute references. Indirect references are placeholder names that must be manually linked to the resource when uploading the JasperReport. The syntax for an indirect reference contains only a placeholder name for the resource, for example:
repo:myImageLink

When you upload a JRXML with this reference, the server prompts you to provide the resource. You have two choices:

Creating a new resource, in this case by uploading an image, that becomes part of the JasperReport. This is called a local resource. You cannot access this resource from elsewhere in the repository, it exists only within the JasperReport. Selecting a resource from the repository, called an external reference because it is external to the JasperReport. This allows any number of reports to link to the same resource, yet allow that resource to be managed independently of them.

While indirect references require slightly more work than absolute references in the JRXML, the server manages the dependency. Local resources exist as part of JasperReport, and the server doesnt allow you to delete resources that are being referenced. No one can delete the resource without first removing the external reference, either by editing the JasperReport to change the external reference or by deleting the JasperReport that contains it. In cases when you dont want to reference existing resources, local resources allow reports to be highly customized and selfcontained. A local resource that is defined inside the JasperReport has all the same properties as a repository resource, but it is not accessible in the repository. Users must edit the JasperReport to access any resources it defines locally.

38

Repository Administration
Users who are not administrators may create JasperReports but not other resources in the repository. Therefore, if an administrator does not provide them resources for external references, their only option is to create local resources for all dependencies within the JasperReport.

Indirect references are used implicitly in several other cases when you define a JasperReport:

The main JRXML itself is either a local resource created by uploading a file or an external reference to an existing JRXML file resource in the repository. Every report must have a data source, and JasperReports Server gives you the option of creating a new local resource or of using an external reference to an existing data source. Every report must also have a query that matches its data source. You may choose to create a query local resource or use an external reference to an existing query. Parameters in a report are implicitly handled as an indirect reference to an input control. For every parameter named in your main JRXML, you must define an input control either as a local resource or external reference. For input controls, you must specify a datatype or list of values, either as a local resource or as an external reference to one in the repository. A query may optionally define a data source, either by creating a local data source resource, or by referencing an existing one in the repository. Domains may reference XML design files that are either created in the Domain Designer or uploaded from an external file resource. Domains also have XML security files and resource bundles, both of which can be either uploaded as local file resources or referenced from file resources in the repository. OLAP resources in Jaspersoft OLAP rely on other OLAP resources, for example views reference connections, and connections reference schemas. In each case, you can define local resources or external references. For more information, see the Jaspersoft OLAP User Guide.

Indirect references are also used implicitly when administrators define the following resources in the repository:

Every level of indirect referencing is independent of the other. For example, when creating a JasperReport, you may choose to create an input control as a local resource, but that input control may use an external reference to its datatype. The server still manages the dependency between the local input control and the datatype resource in the repository.

3.2.4

Data Snapshots

As of JasperReports Server 4.7, report resources may also store a snapshot of the report data. A snapshot is a copy of the data that the query returns when the data is refreshed. This data snapshot is an internal structure that is not visible nor accessible from the repository. However, when data snapshots are enabled, a data snapshot is stored in the repository with each report. When users open a report, the report viewer retrieves and displays from the snapshot. Users then have the option of refreshing the data in the report viewer, and if they have permissions, saving the data snapshot back into the report resource. For more information about interacting with data snapshots, see the JasperReports Server User Guide. To enable snapshots, see section 7.11, Enabling Data Snapshots, on page 128.

3.3

Managing Folders and Resources

Administrators and users with the proper permissions can create, modify, move, and delete folders and resources in the repository. The specific roles and permissions of the user determine the actions that are available. For the definition of the permissions on folders and resources, see section 3.5, Permissions, on page 46. One responsibility of a JasperReports Server administrator is to set up an environment for users to create and save dashboards, Ad Hoc views, and reports. That usually means creating a folder structure where users have write permission. Users with write permission may also create their own sub-folders to store their reports and dashboards. Another scenario that administrators can set up involves the resources for users to create JasperReports. When given write permission, users have the ability to upload JRXML files and define resources inside the JasperReport. But for security reasons, only the administrator can create shared data sources and other resources in the repository. If many users are uploading JRXML files as JasperReports, the administrator should create shared data sources and resources ahead of time in

39

JasperReports Server Administrator Guide the repository. This also has the benefit of simplifying maintenance, for example updating one shared logo file instead of having many users edit their reports.

3.3.1

Resource IDs

All resources, including folders, have an ID, a name, and an optional description: The ID is used internally to reference resources. As with files, the ID must be unique within its folder, but may exist in several folders. The name is a label for the resource displayed in the repository UI. The optional description appears in the repository and in tooltips. You can give longer descriptions to resources to help users understand their contents or purpose.

As in a file system, the IDs of nested folders containing a resource define the path to the object. For example, the path to a report might be: /reports/samples/Freight. The path of every resource is shown under its name in the repository listing or search results. To view the name and resource ID of a resource, right-click the folder or the resource in the repository or search results and select Properties... from the context menu.

Figure 3-1

Resource Properties Dialog for a Writable Resource

If you have write or administer permission as shown in the figure, you can also edit the name and description of the resource.

3.3.2

Creating Folders

Any user with write permission on a folder can create new sub-folders.
To create a folder:

1. 2. 3. 4.

Log on as a user who has write permission to the parent folder. Select View > Repository and locate the parent folder in the left-hand Folders panel. Right-click the parent folder and select Add Folder from the context menu. The Add Folder dialog appears.

40

Repository Administration

Figure 3-2 5.

Add Folder Dialog

Enter a folder name and optional description, then click Add. The folder is created in the repository. The name appears in the hierarchy of folders. The description is only visible when viewing the properties of the folder, as shown in Figure 3-1. New folders and their future contents inherit the permissions of their parent folders. Administrators can change the permissions on the new folder, as described in section 3.5.6, Setting Permissions, on page 49. End users cannot change permissions in the repository unless they have been granted the Administer permission by an administrator.

3.3.3

Adding Resources

Each resource has different requirements, for example some are created from uploaded files, others are created by defining values in a wizard. Specific procedures for adding each type of resource are given as follows:

Interactive resources such as Ad Hoc views and dashboards are described in the JasperReports Server User Guide. JasperReports are covered in the JasperReports Server User Guide. Domains are covered in the JasperReports Server User Guide. Domains are only available in the Pro version of JasperReports Server. Mondrian and OLAP resources are covered in the Jaspersoft OLAP User Guide. Data sources, queries, input controls, and file resources are explained in Chapter 4, Resources in the Repository, on page 53.

Most resources are created through the Add Resource menu item on the context menu for folders in the repository. Figure 3-3 shows the full menu and submenu with all the resources administrators can create:

Figure 3-3

Add Resource Context Menu Expanded

41

JasperReports Server Administrator Guide For every resource you create, you must specify a name and resource ID that can used to reference the resource in the repository. In addition, each dialog has one or more pages for specifying the values and controls specific to the resource you are adding.
New resources inherit the permissions of the folder in which they are created. Administrators can change the permissions on the new resource, as described in section 3.5.6, Setting Permissions, on page 49.

3.3.4

Renaming Folders and Resources

Any user with write permission on a folder or resource can change its name and description.
You cannot change the name of an organizations top-level folder in the way described here. The name of the toplevel folder is copied from the name of the organization. Therefore, to change the name of the folder, you have to change the name of the organization, as described in section 2.1.4, Editing an Organization, on page 24. To rename a folder or resource:

1. 2. 3.

Log on as a user who has write permission for the folder or resource. In the repository, browse or search for the resource. For renaming folders, select View > Repository and locate the folder. Right-click the object and select Properties... from the context menu. The Properties dialog appears.

Figure 3-4

Properties Dialog for a Report Resource

You can change the folder or resources name and description, but not other information, such as resource type and ID; these data are created by the system and displayed here for information only. 4. Click Submit to save your changes.

3.3.5

Copying and Moving

The repository interface lets any user with the proper permission copy or move both resources and folders. Copying requires read permission on the source, moving requires delete permission on the source, and both require write permission on the destination folder. You can drag-and-drop the objects, or you can copy-paste or cut-and-paste them from their context menus. Folders must be moved one at a time, but multiple resources from the same folder can be copied or moved together. Copying and moving actions are not possible on the search interface, only on the repository interface showing the list of folders. Currently, it is not possible to create a copy of a resource in the same folder.

42

Repository Administration
The moved objects inherit their permissions from the destination folder in which they are placed; they do not keep the permissions they had before the move. If you want the objects to have other permissions, you must set the permissions again after the move (see section 3.5.6, Setting Permissions, on page 49). To copy or moving folders and resources:

1. 2. 3.

Log on as a user who has the required permissions for the folder or resource. Click View > Repository, and expand the folders to display the object to be copied or moved. Right-click the object and select Copy or Cut. If the Cut command does not appear in the menu, you do not have delete permission required to move the object. You can select multiple resources with Control-click or Shift-click, but you can select only a single folder at a time. Right-click the destination folder and select Paste in the context menu. If the Paste command does not appear in the menu, you do not have write permission there. Alternatively, you can drag the selected resource or folder to move it the destination folder. To perform a copy, you must press the Control key before clicking to drag. When dragging resources, the destination folder is highlighted in blue if you have permission to write there, and in gray otherwise. If you try to move a resource to a location where you dont have permission, the server displays the contents of the target folder, but the resource is not moved.

4.

3.3.6

Editing Resources

The various types of resources have different ways of being edited. For end users who work with interactive resources, editing mostly involves the Open in Designer action on the context menu for dashboards and Ad Hoc views. The procedures in the following table are further described in the JasperReports Server User Guide. Table 3-4 Resources That End Users Can Edit How to Edit
Professional edition only. Users select Open in Designer and modify the view interactively. After changing the content, users can overwrite the existing view or save as a new view. Reports created from Ad Hoc views are saved in the same format as JasperReports, but the resources referenced in the report unit are generated by the Ad Hoc editor and should not be modified. There is one exception: administrators may create a JSP file and set it as a custom report view. Dashboard Professional edition only. Users select Open in Designer and modify the dashboard interactively. After changing the content, users can overwrite the existing dashboard or save it as a new dashboard. Report output is a file stored in the repository. These files cannot be edited, only downloaded or deleted. Users select Edit and change the data source, input controls, or file resources that are referenced in the JasperReport. Administrators may also edit JasperReports. For more information, see section 3.2, JasperReport Structure, on page 37. When users Run a report, it is displayed in the interactive report viewer. If data snapshots are enabled, the report is displayed with data that was previously retuned by the data source. When data snapshots are not enabled, the server queries the data source and runs the reports query. After interacting with the reports columns and values, users may save the report, either by overwriting the original or as a new copy, depending on users permissions. Report Version Professional edition only. Users may select Edit to change the values stored as input parameters.

Resource Type
Ad Hoc views

Content Resource JasperReport

43

JasperReports Server Administrator Guide For the other resources in the following table, editing is accessible only to administrators. End users, even those with write permission on a resource, cannot edit these resources. Table 3-5 Resources That Only Administrators Can Edit How to Edit
Administrators select Edit from the context menu on these resources. Editing these resources uses the same dialog that was used to define the resource when it is first added to JasperReports Server. Administrators can view the current definition of a resource or change the values that define a resource. For example, you could view the datatype of an input control, change a query, or upload a new file in a file resource. In the case of Domains, you also have access to the Domain Designer used when creating the Domain. You can add tables and fields, change filters, or change the display characteristics of items in the Domain. For more information about Domains, see the JasperReports Server User Guide. For all other resource types, see the procedure for creating it in Chapter 4, Resources in the Repository, on page 53.

Resource Type
Data Source Datatype Domain File Input Control List of Values Query

When editing a resource, there are several limitations:


You can modify the name or description of the resource, but not its ID. If you must remove an ID, you need to create a new, similar resource and delete the old one. You cannot change the location of the resource. Some dialogs for editing a resource include the saved location, but the field is for information only. To change the location of the resource, see section 3.3.5, Copying and Moving, on page 42. For file resources, you cannot see the name of the file that was uploaded, nor in most cases download and view the contents of the file. Your only option is to upload a new file to replace the old one.

3.3.7

Deleting Folders and Resources

Users with delete permission on a folder or resource can delete those objects from the repository. In order to delete a folder, the user must also have delete permission on all the resources and folders that the deleted folder contains, because the entire contents of the deleted folder are deleted as well. Folders must be deleted one at a time, but multiple resources can be deleted together.
There is no undo from a delete.

The repository keeps track of which resources are referenced by other resources. It does not allow you to delete resources if they are still referenced by other resources. For example, an input type that is used by a report or a properties file that is used by a Domain cannot be deleted as long as the report or Domain still references them. To find the resources that reference the one you want to delete, you need to look at each report, view, Ad Hoc Topic, or Domain that you suspect of referencing it. When you edit the definition of a JasperReport or a Domain, you can see the resources it references. Then you can either remove the reference from the resource or delete the entire resource containing the reference.
To delete a folder or resource:

1. 2. 3.

Log on as a user who has delete permission for the folder or resource. In the repository, browse or search for the object to be deleted. Right-click the object and click Delete in the context menu that appears. In the repository view, you can select multiple resources and click Delete in the tool bar or in the context menu. In the list of folders, you can only delete single folders at a time, although all contents of the folders, including subfolders are deleted. In the search results, you can select multiple resources and right-click to select Delete in the context menu.

44

Repository Administration

3.4

Multiple Organizations in the Repository

If you implement multiple organizations, there are certain considerations when designing the repository structure for your deployment. Multiple organizations are only available in the professional edition of JasperReports Server.

3.4.1

Organization Folders

In the repository, each organization has its own branch, contained in a folder named after the organization. JasperReports Server automatically restricts users view and access to the branch of the repository in their organizations folder. Organization admins can create any folder structure needed within the organization. The top folder of an organization is contained in a folder called Organizations in the parent organization. Top-level organizations are contained in a folder called Organizations at the root of the folder hierarchy. Administrators can view and browse the Organizations folder, and if any suborganizations are created, they can also view all folders and resources in the suborganization. As administrators of the parent organization, they can also create folders and resources in the suborganization.
By default, users of an organization can also view and create folders and resources in any suborganization. To prevent this, administrators can change the permissions on the Organizations folder or individual organization folders.

The Organizations folder in every organization is a special folder that is managed by the server. Administrators cannot create folders or resources directly in the Organizations folder. The server creates the folder for each suborganization when the administrator creates a new organization through the Manage > Organizations page. Administrators can create folders and resources in the Folder Template folder in the Organizations folder; these resources are copied into new organizations. For more information, see section 2.1.3, Default Folders for Organizations, on page 24.

3.4.2

Design Considerations

Careful design of the JasperReports Server repository leads to a clear and robust environment for your BI environment and easy yet secure access for users. One of the main decisions is how you want your organizations and users to access resources: which resources are shared across organizations as opposed to which are specific to a particular organization. This usually breaks down into several scenarios, depending on the resources that organizations need:

Organizations have private resources - Organizations have separate data sources, reports, OLAP views etc. This would be typical in an organization with departments. These private resources would be stored in each organization's own folders, and perhaps only a few resources such as company logos would be shared between them. Organizations share resources - Resources are kept in the public folders where they can be used by all organizations and users. You may have common data sources and reports across customers, but the underlying data is partitioned by organization. Data level security restricts what users see when running public reports and OLAP views. Organization share resources, but have some customizations - For example, users in the organization create reports that are private and stored locally, but they access resources in the public folders. Organizations have a hierarchical organization - You can have one organization containing other organizations. By default, the parent organization can access all the resources of its child organizations. If you don't want this, you must avoid creating suborganizations or customize the servers multi-organization architecture.

3.4.3

Referencing Resources in the Repository

All resources in the repository can be referenced by Universal Resource Identifiers (URIs), which specifies the resource name and folder path of the resource. Because of the hierarchy of organizations, references are relative to the user accessing them. JasperReports Server transforms relative references into actual resource locations in the repository based on the users organization and the organizations main folder. By default, folder locations are transformed in the following ways:

For organization members, locations in /public are not transformed, but those in the organizations main folder are transformed to the actual location, for example, /organizations/organization_1.

45

JasperReports Server Administrator Guide For example, if a user in org_1 runs a report that references /images/myLogo image resource, the actual path in the repository that is fetched is /organizations/org_1/images/myLogo. If the report also references /Public/sharedLogo, the server fetches the resource in /Public/sharedLogo.

For system admins, locations throughout the repository are not transformed. They see the actual repository path names. If a system admin runs the same report in the example above, the reference to /images/myLogo attempts to fetch a resource named /image/myLogo, which only works if there is a folder at the root of the repository named images with a copy of the myLogo. The report fails (or is missing a resource) when run by the system admin, unless he logs in as that user through the Manage > Users page.

This transformation enables URIs to reference different resources depending on the organization of the user who accesses them. For example, a report may have an organization-specific logo as an image. We can set up the report as follows:

Logo URI specified in the JRXML: /images/orgLogo. When transformed for each user, the URI accesses a location relative to his organizations main folder. Every organization using this report must have a folder named /images containing an image resource with the ID orgLogo. When a user in any organization runs the report, the server fetches the organization-specific image and displays it. In report units, references to data sources, JRXMLs, or input controls. In OLAP views, references to OLAP connections. In OLAP connections, references to data sources or schemas. For maintenance tasks on an organizations report units, OLAP views and OLAP connections, you must log in to that organization and do the tasks there. You cannot administer the resources as superuser or another organizations admin. The three resources (report units, OLAP views and OLAP connections) cannot reference objects across organizations or even in their own parent organization. The reference would not be transformed; it would be taken literally and would fail. For example, if the data source for a report unit is in the /dataSources folder of This_Org, users in That_Org cannot access it because their reference cannot cross organizations.
To test the absolute references, you should login as an admin of the organization using the references. See section 3.5.7, Testing User Permissions, on page 50.

There are three exceptions to references being transformed. In these cases, the references must be literal:

Also, because these references are not transformed, you must observe the following:

3.4.4

Best Practices

The best practices for resources in a repository shared by multiple organizations are as follows: The system admin must login as an organization user in order to maintain or run organization resources Resources with absolute references to resources in organization folders only work for users within the organization or a parent organization If a JRXML that accesses organization resources with URIs must run across organizations, then all organizations must have identical folders, object names, and expected object types for those resources. The public folder should be used for resources that are shared across organizations.

3.5

Permissions

Permissions on folders and resources determine what users see in the repository and what actions they are allowed to perform. In the following table, the actions granted for each permission include all of the actions granted for permissions above it, except for the No Access permission. The actions granted for each permission strictly exclude all of the actions granted for permissions below it.

46

Repository Administration Permission


No Access Execute Only Read Only

Actions Granted on Repository Folders and Resources


Users can never see or access the folder or resource either directly in the repository or indirectly when running a report, dashboard, or OLAP view. Users can never see the folder or resource in the repository, but the reports, dashboard, or OLAP views that they run can access them.
See the folder or resource in any JasperReports Server dialog See the properties of a folder or a resource Copy a folder and all of its readable contents Copy resources individually or in bulk View (run) a report, dashboard, or OLAP view Run a report in the background Schedule a report to run later

Read + Delete

Cut (move) a folder and all of its contents Delete a folder and all of its contents Cut (move) resources individually or in bulk Delete resources individually or in bulk

Read + Write + Delete

Add a subfolder Paste into a folder (copy or cut) Save a new Ad Hoc view, report, or dashboard in a folder Save the output of a scheduled report in a folder Rename a folder or resource and change its description string Open an Ad Hoc view in the Ad Hoc Editor or a dashboard in the designer Modify and overwrite an existing Ad Hoc view, report or dashboard Add a JasperReport resource to the repository (upload a JRXML) Edit the definition of a JasperReport resource in the repository (replace the JRXML)

Administer Administer and ROLE _ADMINISTRATOR

Set the permissions (by role and by user) on a folder or resource. This effectively

delegates certain repository administration tasks.


Add (create) a resource in a folder Edit a resource, for example the components of a report unit or a Domain

Permissions apply when browsing or searching the repository, as well as when using any dialog that accesses the repository, such as when browsing folders to save a report. Note that:

Copying does not preserve the permissions on an object. Users may copy a read-only object, paste it into a read-write folder, then edit the object. For more details, see section 3.3.5, Copying and Moving, on page 42. Copying and cutting (moving) actions can only be completed if the user has Read + Write + Delete access to the folder in which the object is pasted. For more details, see section 3.3.5, Copying and Moving, on page 42. Cutting, deleting, and setting permissions on folders is allowed only if the user has the same permission on all folder contents. Cutting and deleting resources in bulk is allowed only if the user has at least Read + Delete permission on all selected resources. Deleting a resource or the contents of a folder is only allowed if no other resources rely on them. For more details, see section 3.3.7, Deleting Folders and Resources, on page 44.

3.5.1

Inheriting Permissions

According to the permission architecture, there is a permission setting for every user and role on every folder and resource in the repository. To simplify the definition of permissions, JasperReports Server supports the inheritance of permissions from the parent folder of a folder or resource. If no permission is explicitly defined for a user or role on a given folder or resource, the user or role has the same access permission that is defined on the parent folder. When a permission is defined explicitly, that permission is enforced, regardless of those on the parent folder. 47

JasperReports Server Administrator Guide Using this mechanism, administrators can manage large hierarchies of content and keep them secure. When the administrator sets a permission explicitly, that permission for a given user or role is inherited recursively by all of the folders contents and subfolders, unless they have an explicit definition of their own. Permissions that are assigned on an organizations top folder are inherited across the entire organization. Permissions that are set on the root folder or (if using the professional edition of JasperReports Server) Organizations folder by the system admin are inherited across multiple organizations. For example, the system admin can make all organizations read-only by default to ordinary users, and each organization admin can make specific folders writable so that users can store their reports and output.

3.5.2

Cumulative Permissions

Because permissions can be assigned to both users and roles, a user belonging to one or more roles may have multiple permissions defined or inherited on any given folder or resource. In fact, every permission must be defined on the root, even if it has the default value of No Access, and therefore every role- and user-based permission on every folder and resource has a setting through inheritance. Therefore, for every folder or resource, every user has a their own user-based permission and the permission assigned to the ROLE_USER. How does JasperReports Server determine the effective permission from the many that apply? Permissions in the server are strictly cumulative, meaning that the least restrictive among the set of all permission applies. Even if a more restrictive permission, such as No Access, is set explicitly, the less restrictive permission such as Read-Only applies, regardless of whether it is inherited or set explicitly.

3.5.3

Administrator Permissions

The JasperReports Server authorization architecture distinguishes between administrators and all other users. Administrators are defined as users with either ROLE_SUPERUSER (available in the professional edition of JasperReports Server only), ROLE_ADMINISTRATOR, or both. By design, system administrators with the ROLE_SUPERUSER always have irrevocable Administer access to the entire repository, including to the contents of every organization. The system administrator cannot modify the permissions for ROLE_SUPERUSER, to prevent being locked out or unable to administer some resource. Therefore, the system admin can set permissions for all other users, on any folder or resource, and in any organization if necessary. In particular, the system administrator can modify permissions for ROLE_ADMINISTRATOR, for example to share some resources across all organizations by making them read-only to everyone, including the organization admins. Organization admins are organization users with the ROLE_ADMINISTRATOR, like the default jasperadmin created in every organization. By default, organization admins have the Administer permissions to everything in their organization, except what the system admin has changed to a lesser permission. However, organization admins cannot change the permissions granted to ROLE_ADMINISTRATOR, to prevent them from overriding the settings of the system admin and from locking themselves out of a folder or resource.

3.5.4

Execute-Only Permission

As in file systems, execute-only permission in JasperReports Server allows running reports, dashboards, and OLAP views to access a resource, but keeps the resource from appearing in the repository. Execute-only permission applies to folders as well, keeping them from appearing in folder tree when users browse the repository, yet still allowing the resources they contain to inherit the execute-only permission. This is useful for hiding folders and resources such as data sources that only administrators and data analyst roles need to access in the repository. However, if your execute-only folder contains read-only resources, those resource are hidden when browsing folders, but can be found, either accidentally or intentionally, by using the repository search. As with all other permissions, execute-only permission is either role-based or user-based, so that certain users may access a resource from a running report, but not others.
If you have data or sensitive content in a resource, always set No Access permission for users or roles that must not be able to access it. Hiding a resource with execute-only permission does not protect against access, because malicious users who find the resource ID may be able to create a report, dashboard, or OLAP view that extracts the sensitive content.

48

Repository Administration

3.5.5

Default User Permissions

For all non-administrator users, the default permission at the root is No Access and any permissions must be explicitly defined. In practice, the default installation of the repository contains sample data with a mix of no access, execute only, read only, and read-write permissions that allow the sample users to access folders and resources. The sample permissions demonstrate a common approach to permissions, allowing users to see the resources they can access and hiding the ones they cant, while administrators have full access. We recommend you familiarize yourself with the permissions mechanism by viewing and setting permissions in the sample data, as described in the following section.

3.5.6

Setting Permissions

Administrators can assign permissions to access any folder or resource throughout the repository. Users with the Administer permission on a folder can assign permissions to that folder and any contents that inherit the permission. Users granted Administer permission to a resource can only set the permissions on that specific resource.
To set permissions on a folder or resource in the repository:

1. 2. 3.

Log in as a user with administrative privileges. In the repository, browse or search for the folder or resource. Right-click the object and select Permissions... from the context menu:

The Permissions dialog opens. It shows the permissions in effect for the selected object. By default, it first shows the permissions given to roles. Permissions that are inherited from the objects parent are indicated by an asterisk (*).

Figure 3-5

Permissions Dialog Showing Permissions by Role

In systems with multiple organizations, the users and roles displayed include only those within the scope of the user. For example, in the default single organization, the organization admin cannot see the permission for the system admin (superuser) or for ROLE_SUPERUSER. Figure 3-5 shows the default role-based permissions on the sample Input Data Types folder as seen by the organization admin (jasperadmin). Members of certain roles can see and modify the input data types stored in this folder; these roles likely correspond to users such as data analysts. Regular users have execute only permission so they do not see this folder, 49

JasperReports Server Administrator Guide but the reports they run can access its contents. Administrators cannot change the permission for their administrator role or user name, to prevent them from removing their ability to set permissions. 4. 5. In the dialog, click User to view the permissions assigned to specific users. Click Role when viewing user permissions to toggle back. For each user or role, you can select a new permission from the drop-down. Figure 3-6 shows the default user permissions on this folder. In the default installation, all permissions are defined by role; therefore, all user permissions are No Access inherited from the root. The figure shows a read-only permission being granted to the sample end user. This gives the user joeuser the ability to see but not modify the Input Data Types folder and its contents. For all other end users, however, the folder is still execute-only due to the settings in Figure 3-5.

Figure 3-6 6. 7.

Permissions Dialog Showing Permissions by User

Click Apply to save your changes. If you toggle between user and role permissions, you must click Apply first to save any changes you made. Click OK to save your changes and close the permissions dialog when you are finished. You can open several permissions dialogs for different resources or folders at the same time, as well as navigate the repository. This helps when trying to set permissions uniformly across several folders or organizations.
There are two special cases when setting permissions:
If a resource inherits a permission, for example Read-Only, you cannot set the permission to the same value, at

least not directly. You need to temporarily change the permission level on the parent folder, then set the explicit permission, then set the parent folders permission back to the original value. When a resource and its parent folder have been set to the same permission in this way, the permission dialog still shows the asterisk as if the permission were inherited. But when the parent is later given a different permission, for example Read-Write, the resource retains its explicit Read-Only permission instead of inheriting Read-Write.
To reset the permission level so that it once more inherits from its parent folder, select a different permissions level

and click Apply, then select the permission with the asterisk and click Apply again.

3.5.7

Testing User Permissions

Once you have configured users, roles, and permissions, Jaspersoft recommends that you test the permissions granted to a few representative users. Testing is also recommended when you add new users, roles, and resources, and when you make any major modifications to your access control configuration.
To test user permissions:

1. 2.

Log in as an administrator. Select Manage > Users.

50

Repository Administration 3. 4. 5. Select the users organization, then browse or search for the user whose permissions you are testing. In the Users panel, select the user. In the Properties panel, click Login as User. The selected users Home page appears. The login information in the upper-right corner shows that you are logged in as that user. 6. 7. 8. 9. In the repository, browse or search for the folders and resources to test. Verify that JasperReports Server displays the expected folders and resources. Make a note of any objects that should be displayed but are not, and any objects that should be hidden but are displayed. When you have verified the users permissions, click Log Out. Your own Home page appears. To change the users permissions, edit the permissions in the repository and modify the user or role definitions. 10. Continue testing until the users permissions are satisfactory. 11. Repeat these steps with several representative users to ensure that your access control is properly configured. An access control configuration that hasnt been tested doesnt secure your data adequately.

51

JasperReports Server Administrator Guide

52

Resources in the Repository

CHAPTER 4

RESOURCES IN THE REPOSITORY

This section describes functionality that can be restricted by the software license for JasperReports Server. If you dont see some of the options described in this section, your license may prohibit you from using them. To find out what you're licensed to use, or to upgrade your license, contact Jaspersoft.

The repository in JasperReports Server stores the resources that can be combined to create a report from an uploaded JRXML file. The previous chapter introduced the repository and how to create folders and generic resources. This chapter goes into detail about how to create some key resources: data sources, queries, input controls, and file resources. These are the resource that users reference when uploading a JasperReport. There are two scenarios for administering JasperReports Server, depending on how your end users create and consume reports.

If you have users who are proficient at creating their own reports in iReport, they can upload them as JasperReports to the server. In this case, administrators must work with users to prepare the resources required by their reports. In the second scenario, administrators create and upload JasperReports to the server for their less technical users. Administrators still need to define all the resources for the reports that their users request. Data Sources Queries Input Controls File Resources

This chapter contains the following sections:


4.1

Data Sources

A data source is a resource in the repository that defines how and where to obtain the data displayed by reports or OLAP views. Typically, it includes the location of the data and the details you need to access it, such as a user name and password. For example, to access an RDBMS (Relational Database Management System) that stores your data, you would create a data source that included the URI of the database server and user credentials. JasperReports Server can access any database using the JDBC (Java DataBase Connectivity) API. Most database vendors provide a JDBC driver to access their product, for example DB2, MySQL, Oracle, PostgreSQL, and Vertica (to name but a few). In this case, you can configure two types of data sources in the repository:

JDBC data source Establishes a direct connection to the database server using its JDBC driver. JasperReports Server configures and manages the connections to the database. By default, the maximum number of simultaneous connections for each data source is five.

53

JasperReports Server Administrator Guide

JNDI data source Calls the JNDI (Java Naming and Directory Interface) service of the application server to locate a database connection. The application server manages the connections to the database and shares them between all applications that it hosts. The configuration of the application server determines the number of connections that are shared. Note that the application server connects to the database using JDBC, meaning that JNDI data sources return results in the same format as JDBC data sources. Hadoop-Hive data source Accesses big data in Apache Hadoop clusters accessed through Apache Hive. Because Hive uses the Hive Query Language (HiveQL) that is similar to SQL but distinct, it has its own data source type. Mongo DB data source MongoDB is another big data product that the server can access through a custom data source type. Virtual data source Allows you to combine multiple JDBC and/or JNDI data sources into a single JasperReports Server data source. Bean data source Allows you to access custom-made report data sources in the form of JavaBeans-based data sources.

JasperReports Server also supports additional data source types:


This section discusses JDBC, JNDI, Hadoop-Hive, MongoDB, virtual, and bean data sources. In the case of analysis data, JasperReports Server supports OLAP data sources (such as Mondrian and XML/A connections). For information about analysis data sources, refer to the Jaspersoft OLAP Ultimate Guide.
You can extend JasperReports Server to support any custom data source. Custom data sources consist of Java implementation classes, a message catalog, and a Spring bean definition. For more information about custom data sources, see the JasperReports Server Ultimate Guide.

4.1.1

JDBC Data Sources

To access an RDBMS from JasperReports Server using JDBC you must have a driver, which must be accessible in the servers classpath. Jaspersoft provides a number of JDBC drivers for popular databases. These drivers are available directly in the installed product and do not require further configuration. For more information on JDBC drivers, refer to the JasperReports Server Installation Guide. When configuring a new JDBC data source that points to new types of database server, you should make sure that the JDBC driver you are using is available in the classpath of the JVM that launches the server. The driver cannot be added on the fly from the user interface; it must already be in the classpath when the server starts before you can use it in a data source. If you need to add a new JDBC driver, it should be placed in the application servers library folder, which is already in the JVMs classpath. For example, if you use the Tomcat application server bundled with JasperReports server, place the driver file in <tomcat>/lib, which corresponds to <js-install>\<application-server-path>\lib. For example, if you installed the server from the installation executable on Windows, the path is C:\Program Files\jasperreports-server-x.x\apache-tomcat\lib.
To add a JDBC data source:

1. 2. 3.

Log on as an administrator. Click View > Repository and expand the folder tree to locate the folder in which you want to create the data source. If you installed the sample data, the suggested folder is Data Sources. Right-click the folder and select Add Resource > Data Source from the context menu. The Add Data Source page appears.

54

Resources in the Repository

Figure 4-1 4. 5.

Setting the Data Source Type

In the Type field, select JDBC Data Source. Fill in the other required fields, along with any optional information. The following table shows typical values for the driver and URL of common databases: Database
Microsoft SQL Server Microsoft SQL Server with jTDS driver MySQL Oracle (thin driver) PostgreSQL Vertica

Driver and URL


com.microsoft.sqlserver.jdbc.SQLServerDriver jdbc:sqlserver://<host>:1433;databaseName=<database> net.sourceforge.jtds.jdbc.Driver jdbc:jtds:sqlserver://<host>:1433/<database> com.mysql.jdbc.Driver jdbc:mysql://<host>:3306/<database> oracle.jdbc.OracleDriver jdbc:oracle:thin:@<host>:1521:<database-instance> org.postgresql.Driver jdbc:postgresql://<host>:5432/<database> com.vertica.jdbc.Driver jdbc:vertica://<host>:5433/<database>

The following figure shows values for connecting to the sample Foodmart database included in the sample data.

55

JasperReports Server Administrator Guide

Figure 4-2

Creating a JDBC Data Source

Set the Time Zone field when the datetime values stored in the target RDBMS do not indicate a time zone. When datetime values are stored in a format other than local time zone offset relative to Greenwich Mean time (GMT), you must specify a time zone so that the server can convert datetime values read from the target database properly. Set the Time Zone field to the correct time zone for the data in the data base. When in doubt, leave the Time Zone field blank. The list of time zones is configurable, as described in the JasperReports Server Administrator Guide.

6. 7.

Click Test Connection to validate the data source. If the validation fails, ensure that the values you entered are correct and that the database is running. Also, see the troubleshooting section A.4, Adding Data Sources, on page 156. When the test is successful, click Submit. The data source appears in the repository.

4.1.2

JNDI Data Sources

Adding a JNDI data source is very similar to adding a JDBC data source. The JNDI data source points to an existing connection that is defined in the application server and published as a JNDI resource or service. Instead of specifying a driver and database as you do with JDBC data sources, you only need to specify the JNDI service name in your application server.
Application servers use JDBC connections themselves to expose a database through JNDI. You must specify the JNDI service name of a JDBC connection.

For information about setting up a JNDI connection in your application server, see the following sections:

56

Resources in the Repository


A.4.5, JNDI Services on Apache Tomcat, on page 157 A.4.6, JNDI Services on JBoss, on page 158 A.4.7, JNDI Services on WebLogic, on page 158

To add a JNDI data source:

1. 2. 3. 4. 5.

Log on as an administrator. Click View > Repository and expand the folder tree to locate the folder in which you want to create the data source. If you installed the sample data, the suggested folder is Data Sources. Right-click the folder and select Add Resource > Data Source from the context menu. The Add Data Source page appears. In the Type field, select JNDI Data Source. The information on the page changes to reflect whats needed to define a JNDI data source. Fill in the required fields, along with any optional information. The service name is the name that the application server exposes through JNDI. The following figure shows values for connecting to the JNDI service for the Foodmart database included in the sample data.

Figure 4-3

JNDI Data Source Page

Set the Time Zone field when the datetime values stored in the target RDBMS do not indicate a time zone. When datetime values are stored in a format other than local time zone offset relative to Greenwich Mean time (GMT), you must specify a time zone so that the server can convert datetime values read from the target database properly. Set the Time Zone field to the correct time zone for the data in the data base. When in doubt, leave the field blank. The list of available time zones is configurable, as described in section C.4.1, Specifying Additional Locales, on page 174.

57

JasperReports Server Administrator Guide 6. Click Test Connection to validate the data source. If the validation fails, ensure that the values you entered are correct, that the database is exposed through JNDI, and that the database is running. Also, see the troubleshooting section A.4.5, JNDI Services on Apache Tomcat, on page 157. When the test is successful, click Submit. The data source appears in the repository.

7.

For details about configuring a JNDI database connection at the application server level and making it available to the servers applications, refer to the documentation provided with your application server. In particular, see the troubleshooting instructions in section A.4, Adding Data Sources, on page 156.

4.1.3

Hadoop-Hive Data Sources

Unlike traditional databases, Hadoop systems support huge amounts of data, often called big data. But this capability has a cost: high latency with access times on the order of 30 seconds up to 2 minutes. As a result, Hadoop-Hive data sources have certain limitations and guidelines for use in JasperReports Server:

Hadoop-Hive data sources are not suitable for OLAP connections. Hadoop-Hive data sources are not suitable for creating reports interactively in the Ad Hoc Editor. Reports based on Hadoop-Hive are not suitable for dashboards. Filters and query-based input controls that rely on Hadoop-Hive data sources will be slow to populate the list of choices. You must configure your query limits and timeout to handle latency (see section 7.10.1, Ad Hoc Settings, on page 121). You must configure your JVM memory to handle the expected data (see the JasperReports Server Installation Guide).

In general, reports based on Hadoop-Hive data sources are best suited to be run in the background from the repository. For very large reports, consider scheduling them to run at night so the output is available immediately when you need it.
To add a Hadoop-Hive data source:

1. 2. 3. 4.

Log on as an administrator. Click View > Repository and expand the folder tree to locate the folder in which you want to create the data source. If you installed the sample data, the suggested folder is Data Sources. Right-click the folder and select Add Resource > Data Source from the context menu. The Add Data Source page appears. In the Type field, select Hadoop-Hive Data Source. The information on the page changes to reflect whats needed to define a Hadoop-Hive data source.

58

Resources in the Repository

Figure 4-4 5. 6.

Hadoop-Hive Data Source Page

Fill in the required fields, along with any optional information. The Hive JDBC URL has the form: jdbc:hive://<hostname>:10000/default When done, click Submit. The data source appears in the repository.

4.1.4

MongoDB Data Sources

MongoDB is a big data architecture based on the NoSQL model that is neither relational nor SQL-based. Jaspersoft provides a connector that allows reports to use MongoDB as a data source. Reports based on a MongoDB data source can be used as Topics that allow users to create Ad Hoc views based on the fields returned by the MongoDB query. However, Domains require relational data sources, and therefore MongoDB data sources cannot be used in Domains.
To add a MongoDB data source:

1. 2. 3. 4.

Log on as an administrator. Click View > Repository and expand the folder tree to locate the folder in which you want to create the data source. If you installed the sample data, the suggested folder is Data Sources. Right-click the folder and select Add Resource > Data Source from the context menu. The Add Data Source page appears. In the Type field, select MongoDB Data Source. The information on the page changes to reflect whats needed to define a MongoDB data source.

59

JasperReports Server Administrator Guide

Figure 4-5 5. 6.

MongoDB Data Source Page

Fill in the required fields, along with any optional information. The MongoDB URL has the form: mongodb://<hostname>:27017/<database> When done, click Submit. The data source appears in the repository.

MongoDB is designed to be accessed through API calls in an application or a command shell. As a consequence, it does not have a defined query language. In order to write queries for MongoDB data sources, Jaspersoft developed a query language based on the JSON-like objects upon which MongoDB operates. JSON is the JavaScript Object Notation, a textual representation of data structures that is both human- and machine-readable. The Jaspersoft MongoDB Query Language is a declarative language for specifying what data to retrieve from MongoDB. The connector converts this query into the appropriate API calls and uses the MongoDB Java connector to query the MongoDB instance. The following examples give an overview of the Jaspersoft MongoDB Query Language, with SQL-equivalent terms in parentheses:

Retrieve all documents (rows) in the given collection (table):


{ 'collectionName' : 'accounts' }

From all documents in the given collection, select the named fields (columns) and sort the results:
{ 'collectionName' : 'accounts', 'findFields' : {'name':1,'phone_office':1,'billing_address_city':1, 'billing_address_street':1,'billing_address_country':1}, 'sort' : {'billing_address_country':-1,'billing_address_city':1} }

60

Resources in the Repository

Retrieve only the documents (rows) in the given collection (table) that match the query (where clause). In this case, the date is greater-than-or-equal to the input parameter, and the name matches a string (starts with N):
{ 'collectionName' : 'accounts', 'findQuery' : { 'status_date' : { '$gte' : $P{StartDate} }, 'name' : { '$regex' : '^N', '$options' : '' } } }

The Jaspersoft MongoDB Query Language also supports advanced features of MongoDB such as map-reduce functions and aggregation that are beyond the scope of this document. For more information, see the language reference on Jaspersofts community website.

4.1.5

Virtual Data Sources

Virtual data sources allow you to combine data residing in multiple JDBC or JNDI data sources into a single data source that can query the combined data. You can combine any number of JDBC or JNDI data sources, including schemas from different databases, databases from different vendors, and different schemas within the same database into a single object. Once you have created a virtual data source, you create Domains that join tables across the data sources to define the relationships between the data sources and allow you to design views and reports based on the combined data. For more information about Domains, see the chapter Creating Domains in the JasperReports Server User Guide.

Domain

Virtual data source

JDBC/JNDI data sources

Figure 4-6

Virtual Data Source Scenario

When configuring a new virtual data source, you should make sure that each data source you wish to include has been configured as a JDBC or JNDI data source, as described in sections 4.1.1, JDBC Data Sources, on page 54 and 4.1.2, JNDI Data Sources, on page 56. When you combine data sources into a virtual data source, you select an alias for each data source you include; this alias is added as a prefix to the tables in the original data source to ensure that table names are unique across the virtual data source.
To add a virtual data source:

1.

Log on as an administrator.

61

JasperReports Server Administrator Guide 2. 3. 4. 5. 6. 7. 8. Click View > Repository and expand the folder tree to locate the folder in which you want to create the data source. If you installed the sample data, the suggested folder is Data Sources. Right-click the folder and select Add Resource > Data Source from the context menu. In the Type field, select Virtual Data Source. Fill in the other required fields, along with any optional information. Locate the data sources you want to use in the Available Data Sources pane. Double-click each desired data source to select it. The data source is shown in the Selected Data Sources pane. Change the Aliases by editing them directly, if desired. The Alias is used to identify the selected data source within the virtual data source; it is also added as a prefix to the name of each table in that data source. Spaces are not allowed. Click Submit. The data source appears in the repository.

The following figure shows values for creating a virtual data source by combining two of the databases included in the sample data: the Foodmart database and the SugarCRM database.

Figure 4-7

Creating a Virtual Data Source

Virtual data sources cannot use the Time Zone field that may be set on individual data sources. If used in a virtual data source, a target data source with a time zone will not return the expected date/time values. Therefore, Jaspersoft recomments that you do not use data sources with time zone settings in a virtual data source.

62

Resources in the Repository You can edit a virtual data source to add or remove the data sources it uses. If the virtual data source is used by a Domain, you can add data sources, but you cannot remove them. Removing a data source from a virtual data source modifies only the virtual data source; the data source you removed remains in the repository.
To edit a virtual data source:

1. 2. 3. 4. 5.

Log on as an administrator. Click View > Repository and expand the folder tree to locate the folder containing the data source. Right-click the data source and select Edit from the context menu. To add a data source, locate the data source in the Available Data Sources pane and double-click. To remove a data source, select it in the Selected Data Sources pane and click the left arrow. Click Submit. If you are attempting to delete a data source from a virtual data source that is used by a Domain, you receive a warning and the data source is unchanged. Otherwise, the data source is updated in the repository.

4.1.6

Bean Data Sources

The bean data source type is a key extension because it allows you to make use of any custom or exotic data that you might need to report on. Bean data sources serve as a bridge between a Spring-defined bean and a JasperReport. The Spring bean is responsible for providing the data or parameters that fill the report. To use a bean data source, you must first configure the underlying Spring bean and make it available in the servers web application context. For example, you would add a bean definition to one of the WEB-INF/applicationContext*.xml files. The bean must resolve to a ReportDataSourceService instance, either directly or by way of a factory no-argument method. You can use any Spring instantiation method (for example, a constructor or factory) and bean scope (for example, singleton or prototype) for the data source service bean. The ReportDataSourceService instance is responsible for supplying data source parameters to the JasperReport. Custom ReportDataSourceService implementations can follow two approaches:

If the implementation can provide the data to be used to fill a report, it needs to wrap the data into a suitable JRDataSource implementation and pass the data using the REPORT_DATA_SOURCE report parameter. If the data comes from the report query by way of a JasperReports query executor, the data source service must set values for the connection parameters defined by the query executor. The connection parameters are usually obtained from the properties of the data source service instance.

For example, you could implement a Hibernate data source service that would be injected in a session factory. The factory would create a Hibernate session that would be passed as a value for the HIBERNATE_SESSION parameter. The JasperReports Hibernate query executor then uses the parameter to run the HQL report query. The ReportDataSourceService interface contains two methods: setReportParameterValues and closeConnection. The former provides data and connection parameter values; the latter is required to close and release any resources or connections created during the call to setReportParameterValues. Once the data source service bean is available through Spring, you can add the bean data source to the repository.
To add a bean data source:

1. 2. 3. 4. 5.

Log on as an administrator. Click View > Repository and expand the folder tree to locate the folder in which you want to create the data source. If you installed the sample data, the suggested folder is Data Sources. Right-click the folder and select Add Resource > Data Source from the context menu. The Add Data Source page appears, as shown in Figure 4-8 on page 64. In the Type field, select Bean Data Source. The information on the page changes to reflect whats needed to define a bean data source. Fill in the required fields, along with any optional information. If the data source service is to be instantiated through a factory method of the Spring bean, you should also enter the name of the method.

6.

Click Test Connection to validate the data source. 63

JasperReports Server Administrator Guide If the validation fails, ensure that the values you entered are correct and that the bean is in the classpath. 7. When the test is successful, click Submit.

Figure 4-8

Bean Data Source Page

4.2

Queries

JRXML reports use a query to select the data to be returned from the data source. The query can be defined in the JRXML itself, or it can be saved in the repository. A query in the repository can be re-used by multiple JasperReports. See the sample queries in the /SuperMart Demo/Common folder in the repository. Reusing a query enables you to adapt reports to different audiences. The query returns the same data from the same data source every time, but each report presents the data in a different way. Reusing a query simplifies maintenance of reports, as well, since all the reports return the same data. Also, separating the query from the JRXML makes it easier to maintain large numbers of reports when the data source changes and the query needs to be updated. See the JasperReports Server User Guide for complete instructions on using JRXML reports. For another means of adapting reports to different audiences, refer to the chapter on Domains in that manual. Query resources can also be used to populate list input controls. For more information, see the chapter on cascading input controls in the JasperReports Server Ultimate Guide.
To create a reusable query resource:

1. 2. 3.

Login as an administrator. Click View > Repository and expand the folder tree to locate the folder in which you want to create the query. If you installed the sample data, the suggested folder is Input Data Types. Right-click the folder and select Add Resource > Query from the context menu. The Add Query page appears.

64

Resources in the Repository

Figure 4-9 4.

Add Query - Name the Query Page

Enter a name and optional description for the query and click Next. The resource ID is filled in automatically. The Link a Data Source page appears.

Figure 4-10 5.

Add Query - Link a Data Source Page

Select the data source and click Next. For this example, leave the default, but other options are presented:

Do not link a data source. If no data source is associated with the query, the server uses the data source that is associated with the report that references this query. Create a new data source. You can define a local data source within this query resource that is not accessible to any other resource. This new data source overrides any data source specified in reports that use this query. Select data source from repository. This creates a reference to a data source in the repository. The data source you select overrides any data source specified in reports that use this query.

After clicking Next, the Define the Query page appears.

65

JasperReports Server Administrator Guide

Figure 4-11 6.

Add Query - Define the Query Page

Select SQL as the Query Language. The query language Domain (sl) is selected when opening Domain-based queries created in versions of the server prior to 3.7. It is used only for backward compatibility and should not be selected for new Domain-based queries.

7.

Enter the following test in the Query String field:


SELECT * FROM orders

8.

Click Save.

By default, JasperReports Server supports SQL, HQL (Hibernate), HiveQL (Hadoop-Hive), MongoDB, and Domain queries, while JasperReports supports several more (such as EJBQL, xPath and MDX). However, JasperReports Server can support queries in additional query languages if there is a properly-configured query executor implementation for each additional language when the server is deployed. A specialized bean data source can be used to support multiple query languages. For information about bean data sources, refer to section 4.1.6, Bean Data Sources, on page 63. Another option is to add new types of data sources to the server, thus extending the reach of the JasperReports Server platform by leveraging one of its main extension points. Custom data sources are described in the JasperReports Server Ultimate Guide.

4.3

Input Controls

Any JasperReport can be parameterized so that its generated output is a function of values given at runtime (query filters), or so that its layout is changed to accommodate different users (such as changing the title). When writing JRXML, you can declare parameters and accommodate any runtime value that needs to be passed into the query executor, the rendering engine, or the calculation engine. However, the parameter information in a JRXML file does not provide everything JasperReports Server needs to build a complete user interface and prompt users for values. You must also define an input control resource that defines the following:

The range of possible values or the list of discrete values that are allowed. The type of input, for example single-select or multi-select, and the widget to display the possible values, for example drop-down list or check boxes. Display options such as labels and whether the value is required. The name of the corresponding parameter in the JRXML.

When a user runs the report, the server uses the above information to prompt the user to enter a value and validate the input. For example, consider a report that returns sales data for all of a companys products; the user might input the name of a product to view by selecting a product name in a list.

66

Resources in the Repository JasperReports Server supports several types of input controls, each of which can map to certain types of parameters in the reports JRXML. The input control also determines the kind of widget the user interacts with:

Boolean Represented as a check box. These input controls return a java.lang.Boolean object to the report engine in response to the users selection. Boolean input controls return Boolean.TRUE or Boolean.FALSE as values, depending on whether the box is checked. Single value Represented as a free-form text box. You must specify a datatype, for example text or numerical value, and the users entry is validated against this datatype. Single-select Represented either as a drop-down list or a set of radio buttons. A single-select input control returns a single value. Multi-select Represented as a list of values (scrollable) or a set of check boxes. A multi-select input control returns a collection of values.

One advanced feature of single-select or multi-select input controls is that the values they present can be the result of a dynamic query. The query retrieves actual values from the data source before presenting them as choices to the user. These queries can contain parameters themselves, for example based on the logged-in user or the selection of a previous input control. Query parameters are described in the JasperReports Server Ultimate Guide. Input controls rely on other resources in the repository, such as datatypes, static lists of values, or queries. You can manage these resources the same way you manage other resources; you can define them locally (available only to the input control) or reference them externally (reusing a resource in the repository). For more information, see section 3.2.3, Local Resources and External References, on page 38.
Ad Hoc views based on Domains and Domain Topics always use locally defined input controls that are created automatically based on the chosen filters. They cannot refer to input controls stored in the repository, and you should not modify them. For more information, refer to the JasperReports Server User Guide. Some input controls rely on queries to populate their options. These more complex controls are described in Querybased Input Controls on page 71.

4.3.1

Datatypes

Datatypes are resources that define the format of a single-value input control, for example text or numerical value. The datatype determines what users can enter in the text field so that it corresponds to the type of the parameter in the report. Furthermore, the datatype can restrict the value, for example setting a range for a number or date, or enforcing a pattern such as an email address in strings. This is all controlled through the datatype associated with the input control. Datatypes can represent one of four types:

Text Number Date Date/time

To create a datatype resource:

1. 2.

Log on as an administrator. Click View > Repository and expand the folder tree to locate the folder in which you want to create the datatype. If you installed the sample data, the suggested folder is Input Data Types.

67

JasperReports Server Administrator Guide 3. Right-click the folder and select Add Resource > Datatype from the context menu. The Add Datatype page appears.

Figure 4-12 4. 5.

Add Datatype Page

Enter a name and optional description for the datatype. The resource ID is filled in automatically. Select the type of the datatype, as well as information related to the type. In this example, select Text as the type of our datatype; you have other options as well:

Text For text datatypes, you can specify a regular expression in the Pattern field. The expression is used to validate the text that the user submits. For instance, you could enter an expression that tests for email addresses. Number With numerical datatypes, you can control the range of acceptable values by specifying minimum and maximum values and whether the specified values are themselves acceptable (Minimum is Strict/Maximum is Strict check boxes). If a Strict check box is selected, the specified value is not acceptable. For instance, for a percent field, you might specify a minimum of 0 and a maximum of 100. If you do not want to accept 0 percent, you would check Minimum is Strict. If you want to accept 100 percent, you would clear Maximum is Strict.

Date and Date/Time For these datatypes, there is a calendar widget in which you can select the desired minimum and maximum values and to make sure the configured date and date/time formats are used. To use the calender, click the calendar icon .

6.

When you have defined the properties of your datatype, click Save. The datatype resource appears in the repository.

We have created a very basic datatype for any type of text input.

4.3.2

Lists of Values

List of values are resources that define a static list of values for single-select or multi-select input controls. For each selection in the list, the list defines a label presented to the user and the value passed to the report when it runs. Depending on the type of input control, the end user selects one or more of these labels as radio buttons, check boxes, or drop-down lists.
To create a list of values resource:

1. 2.

Log on as an administrator. Click View > Repository and expand the folder tree to locate the folder in which you want to create the list of values. If you installed the sample data, the suggested folder is Input Data Types.

68

Resources in the Repository 3. Right-click the folder and select Add Resource > List of Values from the context menu. The Add List of Values page appears.

Figure 4-13 4. 5.

Add List of Values Page

Enter a name and optional description for the datatype. The resource ID is filled in automatically. Enter the name and value for each item in the list and click Add. The name and value are both treated as strings. Users only see the label in an input control that uses the list, and the report only receives the value. To remove an item, click Remove beside its value.

6.

When you have defined all values in the list, click Submit. The list of values resource appears in the repository.

4.3.3

Creating an Input Control

The input control resource determines how the input control functions and appears. As with other resources, input controls can be created locally as part of a JasperReport, in which case they cannot be seen outside of the JasperReport, or they can be created separately in the repository and referenced in multiple reports. To use an input control in a report, the control must meet two conditions:

The parameter name in the input control must correspond to the name of the parameter in the report. No error occurs if there is a mismatch in the names, but at runtime, NULL is passed in as the value of the parameter instead of actual values. The input control and its corresponding parameter must be of compatible datatypes (for example, both must be text types or date types). If there is a mismatch, the report fails and an exception is returned.

This section explains how to create an input control resource in the repository. To reference input controls in a JasperReport, see the JasperReports Server User Guide.
To create an input control resource:

1. 2.

Log on as an administrator. Click View > Repository and expand the folder tree to locate the folder in which you want to create the input control. If you installed the sample data, the suggested folder is Input Data Types.

69

JasperReports Server Administrator Guide 3. Right-click the folder and select Add Resource > Input Control from the context menu. The Add Input Control page appears.

Figure 4-14 4. 5. 6.

Add Input Control Page

Select the type of input control from the Type list. In this example, select Single Value. Enter the prompt to display to users explaining how to use the control. For this example, use the prompt Select the text for the report title. In practice, the prompt text is often the same as the parameter, so the parameter name is automatically filled in from the prompt text. If you have used a different prompt, select the automatic name and replace it withe the exact name of the parameter associated with the control. Remember, the parameter name must be the same as in the reports that use this input control. For this example, the parameter name is title. The description is optional. Select options for the control. In this example, select Mandatory and Visible; you have other options as well:

7.

Mandatory Forces the end user to supply a value. Read-only Displays the value of the parameter without allowing the end user to modify it. Visible Makes the input control visible in the report options dialog.

8.

Click Next. Subsequent pages depend on what type of input control you chose above:

Boolean types do not require any further information. Single-value types require a datatype resource to characterize what the user may enter. Single-select and multi-select types based on static lists require a list of values resource. Single-select and multi-select types based on queries require a query resource.

9.

In this single-value example, the Locate Datatype page appears. Choose the option to select a datatype from the repository and click Browse. From the repository dialog that appears, select /datatypes/TextGeneralDatatype, which is similar to the datatype we created in section 4.3.1, Datatypes, on page 67.
If you choose to define a datatype, the wizard takes you through the same procedure as in section 4.3.1, Datatypes, on page 67. You can then define any datatype you need, but it is local to the input control and not reusable in other input controls.

70

Resources in the Repository

Figure 4-15

Locate a Datatype for an Input Control

10. Click Next. The input control resource is created in the repository. 11. Locate the input control in the repository manager. Notice that the text of the prompt that you entered in step 5 is also used as the name for the resource.

4.4

Query-based Input Controls

Query-based input controls display a dynamic set of values for the user to choose from. They are input control resources in the repository, but instead of being based on a datatype or a static list of values, they perform a query to retrieve a list of values. For example, a report could have a city parameter, and the query-based input control could display the list of cities that exist in your data. Because the queries use standard syntax, you can include filters in a WHERE clause. In the previous example, you could restrict the list of cities to a certain country. By including parameters, you can also create cascading input controls. A cascading input control is one whose choices depend on the selection of a previous input control. For example, after the user selects a country, the available city values are restricted to the chosen country. Cascading input controls are query-based controls that contain parameters returned by other controls. Cascading input controls help make input controls easier to use and faster to display. Certain parameters in reports have a natural hierarchy, such as countries and cities or years and quarters, and the cascading input controls let the user find values based on this hierarchy. Instead of selecting cities from one large list that may need to scroll, users can make a selection from a smaller list where all choices are visible. Also, displaying long lists make the web page slow to load, so cascading input controls that reduce the size of the list make it faster to load. If there were an especially large number of cities, more cascading input controls could be used to reduce the list, such as region or state. The values for each control are loaded only when the previous input has been selected, making for a convenient and speedy user experience. The parameter values determined by each cascading input control may or may not be used in the report. For example, if the report only shows data about a city, the country input control exists only to speed up the choice of city. However, if the report also shows information such as city average compared to country average for a given measure, the country parameter is also used in the report.

4.4.1
1. 2.

Creating a Query-based Input Control

In this first example, we create a query-based input control that returns a long list of all cities for the user to choose from. Log in as an administrator. Browse the repository and select the folder where you want to create the query-based input control.

71

JasperReports Server Administrator Guide 3. Right-click the folder and select Add Resource > Input Control. The Add Input Control dialog appears:

Figure 4-16 4.

Adding an Input Control - Naming

Select the type of query-based input control from the type drop-down list. This choice determines how the input control appears to users, either as a drop-down list, a set of radio buttons, a multi-select list, or a set of check boxes. In this example, we choose a single-select query-based input control. Specify the prompt text, parameter name, optional description, and appearance options in the same manner as when defining a regular input control. Click Next. Because we selected one of the query-based types, the Locate Query page appears:

5. 6.

Figure 4-17

Adding an Input Control - Locating the Query

If you have a suitable query resource defined in the repository, you could select it here as an external reference. In this example, well define a query resource locally inside the input control resource.

72

Resources in the Repository 7. Click Next to define the local query resource. The query naming dialog appears:

Figure 4-18

Adding an Input Control - Naming the Query

Although the query resource is not visible in the repository, it may still have a name, ID and optional description within the query resource. However, the values for these fields are not important. 8. Enter any name, and the ID is filled in automatically. Then click Next. The data source link page appears:

Figure 4-19

Adding an Input Control - Linking to a Data Source

As with all query resources, the query resource inside the input control may optionally link to a data source, either in the repository, or its own internally defined one. If no data source is linked, the query in the input control uses the same data source as report. In this example, we take the default selection of not linking to a data source.

73

JasperReports Server Administrator Guide 9. Click Next. The query definition page appears:

Figure 4-20

Adding an Input Control - Defining the Query

10. Select the query language, in this example SQL, and enter a query string. The SELECT statement should contain the names of all fields used in the display, value, or filter for the input control. In this example, the query returns three fields, country, state, and city, and the country field is used to limit the values to a single country. The ORDER BY clause ensures that the values from the query are sorted alphabetically when they appear in the input control. For an example in a different query language, see section 4.4.3, Domain-based Queries, on page 76. 11. Click Save to complete the query definition. The parameter values page appears:

Figure 4-21

Adding an Input Control - Setting Parameter Values

On the parameter values page, you define which field in the results of the query are displayed, and which field contains values that become the parameter value when chosen. a. b. First, specify the value column, which is the field whose value is passed to the report. The data type of the field must match the type of the corresponding parameter in the report. Next, specify the visible columns, which are the fields whose values appear in the input control that the user chooses from. In the simplest case, enter same field as the value column. If you add multiple fields to the visible columns, the

74

Resources in the Repository input control displays the fields together, in the order listed, separated by a vertical bar (|). In the example in Figure 4-21, the user may see and choose from: Los Angeles | CA San Francisco | CA Denver | CO Only the city value (without the state) is passed to the report. Showing additional field in this way can help users find the value they want in long lists of results. The value and display columns may also be entirely different, for example, displaying the full name of a sales representative, but using the employee ID as the value returned by the input control. The only restriction is that all fields used in the value or display list must be selected by the query.

4.4.2

Built-in Parameters for Query-based Input Controls

The LoggedInUser and LoggedInUsername parameters are always available for query input controls; they are always available to reports, as well, even if an input control isnt defined for them. The standard parameters are also provided for reports if they are defined as parameters in the JRXML. Table 4-1 Built-in Parameters for Query-based Input Controls Type
User

Parameter Name
LoggedInUser

Notes
The user that is currently logged in. This parameter isnt available in query input controls, but is used as parameter to the report. The user name of the current user. The full name of the current user. The email address of the current user. Indicates whether the current user is enabled. Indicates whether the current user is authenticated externally. In the commercial editions, the name of the organization of the current user. The roles assigned to the current user. This is helpful for parameters that use $X. The profile attributes of the logged-in user. This parameter isnt usable in query input control, but it is used as parameter to the report. If the user has no attributes, the parameter is an empty map. The names of the profile attributes of the logged-in user. This is helpful for parameters that use $X. If the user has no attributes, the parameter is an empty map. The values of the profile attributes of the logged-in user. This is helpful for parameters that use $X. If the user has no attributes, the parameter is an empty map. For the logged-in user, the value of the attribute matching the name passed as <attribute-name> (like att1). If there is no match, the parameter is empty. This parameter is only available if it is defined in a query or as a report parameter.

LoggedInUsername LoggedInUserFullName LoggedInUserEmail Address LoggedInUserEnabled LoggedInUserExternally Defined LoggedInUserTenantId

String String String Boolean Boolean String Collection<String> Map<String, String>

LoggedInUserRoles

LoggedInUserAttributes

LoggedInUserAttribute Names

Collection<String>

LoggedInUserAttribute Values

Collection<String>

LoggedInUserAttribute_ <attribute-name>

String

75

JasperReports Server Administrator Guide

4.4.3

Domain-based Queries

In the case of reports that use a Domain as the data source (an option available in the professional edition of JasperReports Server), any query-based input controls must contain a query against the Domain. When defining the query as shown in Figure 4-20 on page 74, set the query language to Domain.
The query language Domain ("sl") is selected when opening Domain-based queries created in JasperServer 3.5 or earlier. It is used only for backward compatibility and should not be selected for new Domain-based queries.

Domain queries have their own special syntax, the same that is used in the Domain design. A Domain-based query references fields, called items, by their item IDs, along with any set IDs that determine the path of the item within the Domain. For example, if you want your query input control to return a list store cities, where the field with ID ej_store_store_city is nested in the set with ID expense_join_store, you would use the following Domain query:
<query> <queryFields> <queryField id="expense_join_store.ej_store_store_city" /> </queryFields> </query>

The list contained inside the <queryFields> tag in a Domain query is equivalent to the fields given in the SELECT statement of an SQL query. Given the query above, you can create an input control for a Domain-based report that lets the user select a city as a parameter to the report. Sometimes, you may want the input control to display more information than the actual value returned. As with standard query-based input controls, you can select more fields, and then display those fields in your input control. For example, to make the list of cities unambiguous, you could include the state and country in your display. In that case, the Domain-based query must also retrieve those items:
<query> <queryFields> <queryField id="expense_join_store.ej_store_store_city" /> <queryField id="expense_join_store.ej_store_store_state" /> <queryField id="expense_join_store.ej_store_store_country" /> </queryFields> </query>

Then, when specifying your visible query columns, as shown in Figure 4-24, The COUNTRY Input Control, on page 80, you would add the 3 fields to the list in the order you want them to appear. When specifying fields in the list of visible query columns, use the full ID of the field, including any set IDs. For example, the following list of fields:
expense_join_store.ej_store_store_country expense_join_store.ej_store_store_state expense_join_store.ej_store_store_city

creates a list of values such as the following for users to choose from (the separator | is added automatically): USA | CA | Los Angeles USA | CA | San Francisco USA | OR | Portland USA | WA | Redmond

76

Resources in the Repository Finally, the Domain-based query also has the option to filter the query results, as shown in the following example:
<query> <queryFields> <queryField id="expense_join_store.ej_store_store_city" /> <queryField id="expense_join_store.ej_store_store_country" /> <queryField id="expense_join_store.ej_store_store_state" /> </queryFields> <queryFilterString>expense_join_store.ej_store_store_country == 'USA' and expense_join_store.ej_store_store_state == 'CA' </queryFilterString> </query>

The <queryFilterString> tag contains a DomEL (Domain Expression Language) expression that references the full ID of the fields, including any set IDs. For more information about DomEL, see the JasperReports Server User Guide. The <queryFilterString> tag in a Domain query is equivalent to the WHERE clause of an SQL query. The list of fields in the <queryFields> tag must include all fields being referenced in the filter string.

4.4.4

Cascading Input Controls

A cascading input control is one whose values depend on the selection made in a previous input control. Cascading input controls are created by using parameters in the query string of a related input control. In other words, the parameter defined by an input control may be used in another input control. In the query-based example of cities and states such as: Los Angeles | CA San Francisco | CA Denver | CO the query may still generate a list of hundreds of cities to scroll through. Even though each city is easy to identify with the state, scrolling through a long list is time consuming. With cascading input controls, this example would have two input controls, one for the state and one for the city:

When input controls are displayed, the query for the state input control returns an alphabetical list of unique state names. When the user selects a state, the query for the city input control is triggered and returns the list of cities for that state. The cities are displayed in the input control, and when the user selects one and submits it, the city name is passed as a parameter to the report.

The user makes two selections from much shorter lists, which is easier and quicker than using one long list of city and state names. The second input control is empty, showing no selections, until clicking on the first of the cascading input controls. If the user selects a different state in the first control, the list of cities in the second control updates accordingly. Parameter substitution in query input controls follows the same approach as for JasperReports queries. Queries of all types of query connections can use parameter substitution, and $P, $P! and $X (for SQL queries) parameters are supported. For more information on using $P, $P! and $X to build dynamic queries, refer to the JasperReports Ultimate Guide and the iReport Ultimate Guide. In almost all cases, the parameters appear in the filter (WHERE) clause of the query. Single-select query input controls return single values that are referenced with the $P syntax, and multi-select query input controls return collections that are handled by the $X syntax.
When defining these parameters in a report, dont use a defaultValueExpression element. Due to a limitation in JasperReports Server, these parameters are null when a defaultValueExpression is provided.

77

JasperReports Server Administrator Guide 4.4.4.1 Parameters in Input Control Queries

The example in this section shows how to create cascading input controls for selecting a country and a city. This is done by writing the query of the second input control (city) with a syntax that references a parameter name. The syntax is the same used by JasperReports in the report queries. A parameter is referenced using the following convention:
$P{parameter name}

So if we have an input control called COUNTRY, the query to get the cities from a hypothetical table called ACCOUNTS looks like this:
select city from ACCOUNTS where country = $P{COUNTRY}

When the user selects a country from the COUNTRY input control, the result is used to perform the query of the CITY input control, and the CITY input control is refreshed to show the result. There are two additional ways to use a parameter in a cascading input control query. The first is used when the value held by parameter_name is not a simple value, but a chunk of the query (or in extreme cases even the whole query). It has the syntax:
$P!{parameter_name}

With the $P!{} syntax, the value of the parameter is treated as raw text. The server replaces the placeholder with the value of the referenced parameter without performing extra checking and value escaping, as is done when using the plain $P{} syntax. Secondly, there is the $X{} syntax that is used when the value of a parameter is a collection. In the country/cities example, we can allow the user to pick any number of countries, and show all the cities in the selected countries. Now, the cities are selected in a multi-select input control that returns a collection, and the $P{} syntax is insufficient for substituting a collection into an SQL query. The $X{} syntax appears as follows:
select city from ACCOUNTS where $X{IN, country, COUNTRIES}

When the user selects the values Canada, Mexico, and USA in the COUNTRIES multi-select input control, the $X{} syntax translates into the following query for the CITIES input control:
select city from ACCOUNTS where country IN ('USA','Canada','Mexico') $X{} takes three positional arguments:

First is the collection operator, either IN of NOT IN. Second is the table column that is being compared. Third is the parameter that provides the collection of values, in other words, the name a multi-select input control.

The number of parameters that can be used in a query is arbitrary, just as the number of input controls that can be defined in a JasperReport is arbitrary. In addition to the standard input control parameters, a cascading input control query can use the built-in parameters described in Table 4-1, Built-in Parameters for Query-based Input Controls, on page 75. 4.4.4.2 Step-by-Step Example

In this example, well create a simple report that displays all the accounts of a city, using the SugarCRM sample database shipped with JasperReports Server. This example uses iReport to create a report and the JasperReports Server plug-in to crate the import control resources in the repository. We start by creating a report with a parameter called CITY and the following report query:
select * from accounts where billing_address_city = $P{CITY}

In the detail band, we add three fields: name, shipping_address_city, and shipping_address_country. Then we publish the report on the server, using the Publish tool of the JasperReports Server plug-in in iReport.

78

Resources in the Repository

Figure 4-22

Simple Report Filtered by City

Now define the input controls. Right-click the JasperReport node in the Repository Navigator and add the first input control by selecting Add > Input Control. This input control shows the list of countries in which accounts are present. It is not a cascading input control, but its value is used in the next control: the one that selects the city. Set the name of this first input control to COUNTRY (the display name can be Country). Set the Input Control type to Single Select Query (this because we want to get the countries using an SQL query, but since this is just a common input control, we may use any other type of input control, like a list of values or even a multiple-select list of values). Edit a local resource for the query, set a name for it (query) and set the query language to SQL.

Figure 4-23

Creating the COUNTRY Input Control

79

JasperReports Server Administrator Guide The query is just a simple query to select the countries. For instance:
select distinct shipping_address_country from ACCOUNTS order by shipping_address_country

To complete the local query resource, set the repository resource /datasources/JServerJdbcDS as the querys data source. Finally, in the Value and Visible Columns tab, set the Value Column to shipping_address_country and make it (the only) visible column. The first input control, which selects the country, is now ready.

Figure 4-24

The COUNTRY Input Control

Now that we have an input control named COUNTRY, we can reference the COUNTRY parameter in any query-based input control. This is what we are going to do with the second input control. Set its name to CITY. Its definition is similar to the COUNTRY control, so the type must be Single Select Query. The query resource must be of type SQL; its used in the COUNTRY parameters where condition:
select distinct shipping_address_city from ACCOUNTS where shipping_address_country = $P{COUNTRY} order by shipping_address_city

This time the column to be used in the Value and Visible Columns field is shipping_address_city. When you run the JasperReport, if everything has been correctly configured, the dialog box in Figure 4-25 on page 80 appears. It consists of the two simple input controls, and the CITY control is not populated until the user selects a country.

Figure 4-25

Cascading Input Control Showing Country and Cities

80

Resources in the Repository

4.5

File Resources

File resources are those that the administrator creates by uploading a file. Like other resources in this chapter, file resources are created by administrators so that they can be referenced by Jasper Reports. JasperReports server supports the following files: Table 4-2 File Type
CSS Font Image JAR JRXML OLAP Schema Resource Bundle Style Template XML

File Resource Types Description


Cascading Style Sheet file that helps define the user interface as part of a theme. True Type font (.ttf) file to extend the set of fonts available in a report and allow embedding of fonts in the PDF output, if needed (see 4.5.1, Fonts, on page 81). Any image format supported by the JVM (Java Virtual Machine), such as JPEG, GIF, and PNG. Images can be referenced in JasperReports, and also in CSS files. Libraries that provide functionality for your reports (see section 4.5.2, JAR Files, on page 81) The definition of a report in JasperReports XML-based report definition language. A JRXML file can be uploaded separately for use in multiple JasperReports. Defines the data in an OLAP cube, including how to aggregate the dimensions. A Java .properties file containing key-value pairs for localization of reports (see section 4.5.3, Resource Bundles, on page 82) A JRTX file containing a style template that can be shared between JasperReports. XML file used in Domains and analysis to define data-level security.

The way in which fonts, JAR files and resource bundles are associated with reports is further explained in the following sections.

4.5.1

Fonts

The server relies on the JasperReports library as its content rendering engine, which enables it to produce high-quality, pixelperfect documents. The server can use any fonts that are available to its JVM as logical or physical fonts. This solution is perfect for HTML reports that are stored in the server. However, when exporting the report to PDF, you may need to take additional steps if the report includes fonts that the PDF viewer doesnt recognize, or if the report requires fonts that your users do not have on their computers. In this case, you must embed the font in the PDF file itself. To embed a font, you must edit the reports main JRXML file; the TTF (True Type Font) file that the report references must be available to the server at runtime. One way to ensure that the server has the correct font is to upload it to the repository by creating a file resource. Then, the report can refer to the fonts URI in the repository. For details about working with fonts and PDF export, refer to the JasperReports documentation.

4.5.2

JAR Files

JasperReports can leverage third-party APIs. When run, reports can make direct API calls to third-party code using JRXML expressions. This provides enormous flexibility for incorporating business logic or other utility code into report generation. In some cases, you can make the third-party code available to the report generating process by adding the necessary libraries to the servers application classpath when it is deployed. In other cases, upload the third-party or additional JAR files to the repository by creating a file resource. Then the report can refer to the code by referencing them as additional file resources.

81

JasperReports Server Administrator Guide

4.5.3

Resource Bundles

When a single JRXML template is used to generate documents in multiple languages, it needs a resource bundle to accommodate the locale-specific content. If you upload such resource bundles by creating a file resource, your JRXML files can refer to them. The name of the resource bundle created as a file resource in the repository must have .properties as its file extension. For example, the default resource bundle might be named MyReport.properties, and its French translation MyReport_fr.properties. For more information about resource bundles for reports, refer to the JasperReports Server User Guide.

4.5.4

Creating a File Resource

Administrators should organize file resources into folders in the repository to make them easier to find when creating references.
To add a file resource:

1. 2. 3. 4.

Log in as an administrator. Select View > Repository and locate the parent folder of the new resource in the left-hand Folders panel. In the Folders panel, right-click the parent folder and select Add Resource > File from the context menu, then select the type of resource to add. In this example, select Add Resource > File > Font. The Add File dialog appears. Enter the required information for the file resource. In additions to the name and ID, file resources only require you to enter the path to a file or click Browse to locate a file on your file system. Figure 4-26 shows the dialog for adding a Font file. All file resources are created by uploading a file in a similar fashion.

Figure 4-26 5.

Adding a File Resource

When done, click Submit. The new file resource appears in the selected folder in the Repository panel. A message confirming the addition also appears at the top of the page.

82

Resources in the Repository

4.5.5

Editing a File Resource

The following example shows how to edit a file resource.


To edit a file resource:

1. 2. 3.

Log on as an administrator. In the repository, browse or search for the resource. Right-click the resource and select Edit from the context menu. The Edit File dialog appears much like the Add File dialog except for some properties that cannot be changed. In this example, we edit the font resource created in section 4.5.4, Creating a File Resource, on page 82.

Figure 4-27 4.

Editing a File Resource

Use the Edit dialog to view or modify the resource definition and its values. Figure 4-27 shows how the Description field was changed. You can also change the contents of the file resource by specifying another file to upload. The Path to File field is not required unless you want to reload the file from disk. Click Submit to save any changes.

5.

83

JasperReports Server Administrator Guide

84

Themes

CHAPTER 5

THEMES

This section describes functionality that can be restricted by the software license for JasperReports Server. If you dont see some of the options described in this section, your license may prohibit you from using them. To find out what you're licensed to use, or to upgrade your license, contact Jaspersoft.

Themes in JasperReports Server are a mechanism to define and customize the user interface (UI) through Cascading Style Sheets (CSS), the web standard for defining the appearance of HTML content. A theme is the set of all CSS files and associated images that defines the appearance of the user interface. Themes are stored as file resources in folders in the repository, with special menus on theme folders for activating, uploading, and downloading a theme. You can store any number of themes in the repository, and administrators can switch between them, providing an easy and quick way to change the user interface. For deployments licensed to use organizations, administrators can set the theme individually on each organization, or rely on theme inheritance to use the same theme everywhere without needing to set it explicitly. The inheritance mechanism also supports a mix of explicit and inherited settings, so that you can override any setting or image in a local organization, but inherit the rest of the theme from the parent or system-wide theme.
The theme mechanism was introduced in JasperReports Server 4.0, and the set of files in the default theme was updated in 4.7. Custom themes developed prior to 4.7 may require upgrading in order to work with the new set of files. For more information see the upgrade procedures in the JasperReports Server Installation Guide.

This chapter contains the following sections:


Introduction How Themes Work Administering Themes Working With CSS Files

5.1

Introduction

The appearance of the JasperReports Server user interface is shown in figures throughout this book. The default appearance can easily be modified to suit your needs. The JasperReports Server user interface is based on CSS (Cascading Style Sheets) files that define the styles of the elements appearing in the HTML, itself defined in and generated from JSP (JavaServer Pages) and JavaScript. A theme is a collection of CSS files and associated images that specify the appearance for all or part of the user interface. A theme only controls how the interface appears, for example fonts, colors, spacing, lines, and image elements of the UI. It does not control what appears, such as the contents of menus or the effect of clicking a button. 85

JasperReports Server Administrator Guide Themes are defined globally at the repository root and individually on every organization. Every user of a given organization sees the same theme, but different organizations can have their own themes. Only administrators can set the theme. Administrators can add, upload, edit, copy, and delete the files that make up the theme, just like other resources in the repository. The repository provides special actions on theme folders for downloading and uploading themes as ZIP (compressed archive) files, and for activating the theme.
Themes are fully integrated with the multi-organization architecture in JasperReports Server. Some features of themes discussed in this chapter apply only to deployments that are licensed to use multiple organizations. However, single-organization deployments use the same architecture, for example there are overrides and inheritance between themes in the single default organization and the system root.

The themes mechanism is hierarchical and very flexible, allowing administrators to easily change the global appearance or set organization-specific overrides. For example, all of the following scenarios are possible with the themes mechanism: Scenario
Use the default theme unchanged.

Description
The UI has been updated for clarity and space considerations. After a standard installation, the default theme is set at the root level and is automatically inherited by all organizations so that every user sees the server with this interface. If the default theme suits your needs, there is no need to customize it or develop new themes. You can specify overrides of individual CSS rules or replace images in the system theme. It is easy to create or upload the new files and activate your customizations. The inheritance mechanism ensures that every organization uses this new theme and is updated in real time when you modify it. With CSS experience or Jaspersoft Professional Services, you can change the entire look and feel of the server. The server UI can be tailored to match or blend in with nearly any other web design. The inheritance mechanism again ensures that every organization uses the new theme, while allowing you to manage the interface from a single set of files. You can give each organization or suborganization a customization of the default theme, for example a new logo, while retaining all other aspects of the system theme. The benefit of this approach is that the system theme can still be modified and inherited by all organizations, while still retaining the organization-level overrides. This approach can be combined with the previous one, so that overrides are applied to the custom theme.

Quickly modify the default theme.

Create an entirely new theme.

Override themes to customize the UI for every organization.

Create a new theme in every organization.

For SaaS vendors, each organization can be a different client that needs a special interface. The themes mechanism allows each organization to fully define the UI and still retain the override and inheritance mechanism for its own suborganizations. In such deployments, each organization admin can modify or create the appearance of his own user interface.

It is important to realize that a theme refers to two concepts simultaneously:


A folder containing a set of CSS files and image files in the proper location in the repository. The entire appearance of the user interface after activating the themes files. However, through the inheritance mechanism, parts of the interface are defined in the files belonging to other themes. In fact, except for the default theme, the entire user interface is rarely defined in a single theme.

For example, a very simple theme named MyLogo contains a custom image file to replace the Jaspersoft logo, and nothing else. The rest of the interface is inherited from the default theme or some custom theme. Yet we say that MyLogo is the active theme, and every user in the same organization sees the MyLogo theme.

86

Themes

5.2

How Themes Work

Themes are stored in a special folder named Themes that appear at the root of the repository and in every organization. Each Themes folder contains a default theme that cannot be edited and any number of custom theme folders. Each theme is stored in its own folder and is known by the name of the folder. The folder named default in every Themes folder is a special theme whose contents are controlled by the server. In the Themes folder at the root, the default theme contains the complete definition of every style that makes up the default theme shipped with JasperReports Server. In organization Themes, the default is a system generated theme that contains all styles inherited by the given organization. None of the default theme folders can be modified, even by administrators. This chapter uses the following terminology to distinguish between root-level and organization-level themes. In the following table, the main folder of any organization is named Organization, and active-theme is the name of the theme folder that has been activated: Name
Default theme

Folder
root > Themes > default root >Themes > active-theme

Description
The unmodified user interface of JasperReports Server, as it appears at first installation. The default theme is defined in the default folder in the Themes folder at the root of the repository. The active theme set at the root level. All users in all organizations see this theme unless there is an organization-specific theme that is activated. The system theme is also used for the login page. When JasperReports Server is first installed, the default theme is active, so it is also the system theme.

System theme

Inherited theme

Organization > Themes > default

The combination of all active themes in the parent organizations of a given organization, according to the inheritance rules. For any given organization, the theme inherited by that organization is stored in the default folder of that organizations Themes folder. The theme that users of a given organization can see. administrator has set as active at the organization or system level. Users see a combination of the active and inherited theme, depending on the files in the active theme and the inheritance rules.

Active theme

Organization > Themes > activetheme

You cannot modify the files of the default theme through the repository. If you try to do so by circumventing the repository, you could inadvertently change rules such that the UI becomes unusable. In this situation you must re-install JasperReports Server to recover.

The following figure shows the default theme in the Themes folder at the root of the repository. The name of the folder (and its subfolders) are bold to indicate that it is the active theme.

87

JasperReports Server Administrator Guide

Figure 5-1

The default Theme in the Root Themes Folder

5.2.1

Theme Files

A complete theme consists of the files listed for the default theme, as shown in Figure 5-1, along with all referenced images. In addition, the default theme contains the file samples.css that is only used by the View > UI Samples page described in section 5.4.5, User Interface Samples, on page 97. The files overrides_ie7.css and overrides_ie8.css are only loaded with the style sheets when the users browser is Internet Explorer 7 or 8, respectively.
The set of files in the default theme was updated in 4.7. Custom themes developed prior to 4.7 may require upgrading in order to work with the new set of files. For more information see the upgrade procedures in the JasperReports Server Installation Guide.

The default theme stores referenced image files in a folder named images. There are approximately 40 image files in the default theme. In a custom theme, there are two ways to change an image of the default theme:

Use a folder named images and image files with the same name as the ones you want to replace. Modify the corresponding CSS rules to redefine the location where they can be found. Directly in the theme folder. In this case the file is referenced without a path, for example "myfile.png" in CSS. In any folder path located in the theme folder. For example, your custom CSS file could refer to "MyImages/ myfile.png" if you create a folder named MyImages in the theme folder and upload your images there. Anywhere on the internet. Following the CSS standard, your custom CSS can refer to images, or any helper file, with a regular URL.

When you modify the CSS rules, you can use any of the following ways to reference image files, or any other helper file:

5.2.2

Inheritance Mechanism

In order to render the user interface, Jasper Reports Server must load each of the theme files. Because each file can be stored in multiple themes, the inheritance mechanism determines which file to load. The server loads each of the CSS files listed in Figure 5-1. To locate the file, the server looks in the following locations, in the orders listed below. For professional edition users: 1. 2. 88 The active theme folder for the users organization. The inherited theme stored in the folder named <organization>/Themes/default.

Themes For other users: 1. 2. The active theme folder. The inherited theme stored in the folder named /Themes/default

When one of the CSS files references an image file or a helper file, including any path to that file, the server looks for that path and filename in the same two locations, in the same order. In this way, each file and image is resolved first in the active theme, and if not found, then in the inherited theme. The active theme does not need to contain all the files because the inherited theme that is maintained by the server is guaranteed to contain all the files. Maintaining the inherited theme in every organization is the second task of the inheritance mechanism. The server maintains the inherited theme in each organization using the same algorithm. Whenever an administrator changes the active theme or modifies a file in the active theme, the server uses the same algorithm to find all files that define the active theme in this organization and makes a copy of them in every child organization. For nested levels of organizations, the algorithm repeats on each level after updating the copy of the inherited theme. In this way, any changes are propagated down to every organization.
Propagating changes to the inherited themes is computationally intensive and can take several moments after making a change to a theme. However, determining inheritance when changes are made is an effective trade-off so that CSS files for rendering client request are resolved nearly instantly.

5.2.3

CSS Priority Scheme and Custom Overrides

Once the inheritance mechanism determines which files to load, the standard CSS priority scheme determines which rules are visible, based on the order in which files are loaded. This leads to two general ways of developing custom themes:

The quickest way is to copy individual CSS rules from the default theme files, modify the rules to change the UI, and save them in the overrides_custom.css file. Because overrides_custom.css is always the last CSS file to be loaded, its rules override the same rules in other files. This allows you to easily change any number of rules, and manage them all in a single file. For example, if you want to increase the size of text on all the buttons in the default theme, you can do this with a few rules in the overrides_custom.css file. You may need to adjust the spacing for certain buttons, but the idea is you only need to change a limited number of rules.

If you modify the user interface extensively, you can use the existing structure of CSS files in the default theme. In this case, copy the relevant files from the default theme, make your modifications, and save the files in your new theme. The inheritance mechanism uses the new files when you activate the theme. An example of these extensive changes would be if you want to increase the size of the buttons themselves in the default theme. You would need to rewrite the majority of the rules in the buttons.css file and create images for the new buttons. In this case, it is much easier to copy the buttons.css file than to copy dozens of rules into the overrides_custom.css file. You could still use the overrides_custom.css file to adjust the spacing of elements around the buttons, because there would be fewer of those rules to modify.

Jaspersoft recommends using the custom overrides method for most custom themes. A custom theme that changes simple appearances such as colors, fonts, and spacing has relatively few rules and is easily manageable in a single file. And many changes can be made by copying and modifying image files in the custom theme, without writing any CSS rules. Only if you change the fundamental layout or appearance of the user interface, should you consider copying and modifying the other CSS file. Copying and modifying CSS files is more prone to error, and is slightly less flexible due to the file-based inheritance mechanism. Your copy of the file must contain all of the CSS rules as the original. If any rules are accidentally deleted or modified, even by a single character, the theme may not work properly. Also, the unmodified rules in the copy of your file now override any updates made to the same file in a parent organization. For example, if you can copy a file that defines gray buttons with plain text, and you change the CSS rule to make the text bold, to create a theme with bold, gray buttons. However, if the theme on the parent organization or system theme is modified so that buttons are blue, your file overrides the new inherited color, and you still have bold, gray buttons. If you had defined the bold text as a single rule in the overrides_custom.css file, your theme would show bold, blue buttons now. 89

JasperReports Server Administrator Guide

5.3

Administering Themes

Themes are sets of CSS and image files stored in a folder in the repository. The root of the repository and every organization has a Themes folder where active and inherited themes are stored. In the repository browser, the Themes folder and individual theme folders have special actions for administrators to manage them. You can also use the repository search to find CSS and image files. The folders and actions for managing themes are visible only to administrators. The Themes folder has execute-only permission for ROLE_USER so that all users can load the theme files and see the user interface, but not access the folders and files in the repository. This section gives the basic procedures for administering existing themes, and for creating and modifying new theme folders. For information about how to work with CSS in themes, see section 5.4, Working With CSS Files, on page 95.

5.3.1
1. 2. 3.

Setting the System Theme

Log into JasperReports Server as system administrator (superuser in the professional edition; jasperadmin in other editions). Click View > Repository and expand the Themes folder if necessary. Right-click the new theme folder and select Set as Active Theme. For example, the sample data includes a second theme called pods_summer that you can set as active.

Figure 5-2

Setting a System Theme

As soon as the screen is refreshed, you see the effect of the new theme. Notice how the pods_summer theme changes the colors and the logo in the user interface with just the overrides_custom.css file and images.

90

Themes

Figure 5-3

The Sample Theme pods_summer

Because the system theme is set at the root level, the new theme appears to all users in all organizations, unless the organization has its own theme. Also, the system theme set here applies to the login page, as shown in the following figure.

Figure 5-4

The Login Page as Seen With the New System Theme

The following procedures assume that the system theme is still set to the default theme.

5.3.2
1. 2. 3.

Setting an Organization Theme

Professional edition users can give different themes to their organizations. Log into JasperReports server as the organization admin (jasperadmin). In a server licensed to use multiple organizations, specify the organization ID or alias on the login page. Click View > Repository and expand the Themes folder if necessary. The organizations Theme folder is shown in Figure 5-5. Right-click the new theme folder name and select Set as Active Theme.

91

JasperReports Server Administrator Guide As soon as the screen is refreshed, you see the effect of the new theme. The new theme applies to all organization users and is inherited by all suborganizations, if any. Organization admins can thus customize the user interface by creating and activating new themes within their organization.

Figure 5-5

Organization Themes Seen by Organization Admin

5.3.3

Restricting Access to Themes

System admins may want to restrict access to themes, so that all themes are controlled from the system level.
This procedure only applies to system admins. Organization admins cannot modify the ROLE_ADMINSTRATOR permission, even in suborganizations. They must request that the system admin perform the procedure for them.

1. 2. 3. 4. 5. 6.

Log into JasperReports Server as system administrator (superuser or jasperadmin). Click View > Repository. Community edition users can skip to step 5. Expand the Organizations folder. Locate the name of the organization where you want to restrict access to themes and expand its folder. Right-click the Themes folder name and select Permissions. Change the permission for the ROLE_ADMINISTRATOR from Administer to Execute Only.

92

Themes

Figure 5-6

Restricting jasperadmin Access to Organization Themes

By setting Execute Only access, the organization admins cannot see the Themes folder in the repository, and thus cannot change themes or create a new theme.
You shouldnt change any other permissions on themes, even if the permissions dialog allows it. You could inadvertently make the user interface inaccessible.

7. 8.

To restrict access to all organizations, repeat step 4 to step 6 for every organization in the server, including suborganizations. If you want to restrict access in the same way in all future organizations, repeat step 5 and step 6 in the Folder Template of every organization and suborganization in the server. Fore more information, see section 5.3.4.3, Placing Themes in the Folder Template, on page 95.

5.3.4

Creating Theme Folders and Files

There are three ways to create the folders and files that make up a theme: Create them directly as resources in the repository. Download and upload themes as ZIP (archive) files. In multi-organization deployments, placing theme folders in the Folder Template.

This section explains only how to store CSS files in the repository. For information about creating CSS file contents, see section 5.4, Working With CSS Files, on page 95. 5.3.4.1 Creating Theme Folders and File Resources

A theme is simply a folder in the repository that contains CSS and image files, with optional sub-folders. Administrators can use the repository menus to create theme folders. System admins can create theme folders and files at the system level or in any organization. Organization admins can create theme folders and files in their organization or any suborganization.
To create theme folders and file resources:

1. 2. 3.

Log in as an administrator with access to the location where you want to place the theme. Click View > Repository and expand the folder tree to view the Themes folder where you want to place the theme. Right-click the Themes folder and select Add Folder. Give your folder a name and optional description as you would when creating any folder. The folder name is used as the name of the theme.
Theme folders and files can be created, copied or moved anywhere in the repository, but they can only be made active, uploaded, or downloaded when properly placed in a Themes folder.

93

JasperReports Server Administrator Guide 4. 5. 6. 7. Right-click your new folder and select Add Resource > File > CSS, and use the dialog to upload an individual CSS file. In order to be used as part of a theme, it must be one of the file names listed in section 5.2.1, Theme Files, on page 88. To add images to your theme, create any image folders and upload image files with Add Resource > File > Image. Repeat step 4 and step 5 to create all the files and images you need. If several themes use the same files or images, you can copy-paste the file resources or entire image folders from one theme to another. If you need to change the contents of a CSS or image file, you can right-click it and select Edit to specify another file to upload and replace the current file.
If you upload CSS and image files into the active theme, the changes are visible after reloading the page in your browser.

Interacting with theme folders and files through the repository is a convenient and flexible way to create a theme. However, this method suffers from the limitation that, like other repository resources, you cannot download the files or images to edit them. For this purpose, the repository provides special download and upload actions on theme folders. 5.3.4.2 Downloading and Uploading Theme ZIP Files

The process of creating a theme often starts with the files of an existing theme that you modify with CSS and image editors on your computer. To support this workflow, every Themes folder has special commands for downloading and uploading themes. Because a theme is composed of any number of files and folders, JasperReports Server uses the ZIP archive format to store a theme in a single file.
To download a theme ZIP file:

1. 2. 3. 4. 5.

Log in as an administrator with access to the theme you want to download. Click View > Repository and expand the Themes folder if necessary. Right-click the theme folder you want to download and select Download the Theme. This menu selection appears only on theme folders inside the Themes folder. The server prompts you to save the file named <theme-name>.zip. Save it anywhere on your computer. Use an archiving or compression utility to extract the files from the ZIP file and save them on your computer.

Once you have the theme files extracted on your computer, you can view the individual CSS and image files that make up the theme. For example, to create your own theme, start by downloading the default theme from the root/Themes folder (as superuser). Save the extracted file on your computer and create your custom theme in another folder by copying and editing the CSS files and images of the default theme. See section 5.2.3, CSS Priority Scheme and Custom Overrides, on page 89 for an explanation of how to create a theme. When you have created all the files you need in your theme, upload it with the following procedure.
To upload a ZIP file as a theme:

1. 2.

Place the CSS files, optional folders, and images files that constitute your theme in a folder on your computer. Use an archiving or compression utility to create a standard ZIP file of the contents of your theme folder.
The ZIP file should include only the contents of your theme, not the theme folder itself.

1. 2. 3.

Log in as an administrator with access to the location where you want to upload the theme. Click View > Repository and expand the Themes folder if necessary. Right-click the Themes folder and select Upload a Theme.

94

Themes

Figure 5-7 4.

Uploading a Theme in an Organization

In the dialog that appears, enter a name for your theme, which becomes the name of its folder, and browse to find the ZIP file on your computer. Click Upload.
You cannot use the ZIP upload dialog to overwrite an existing theme. You must specify a theme name that doesnt already exist in the chosen Themes folder.

The server uploads your ZIP file and extracts it contents. Then it creates a folder for the new theme and creates file resources in the folder for each of the CSS and images in your ZIP file. If you had sub-folders in your theme, they are created as well. After uploading your theme ZIP file, you can make it active to see effect of your theme on the user interface. Creating a theme is an interactive process where you often need to make changes until you have the look and feel you want. To support this process, uploading ZIP files can be combined with the uploading of individual file resources that is described in section 5.3.4.1, Creating Theme Folders and File Resources, on page 93. In fact, after an initial upload, it is much easier to update individual files in this way than to create the ZIP file and upload it again. 5.3.4.3 Placing Themes in the Folder Template

In deployments licensed to use multiple organizations, you can place a theme in the Folder Template that is used to create new organizations. The theme folder and all of its contents are copied to the Themes folder of any new organizations that are created. Upon creation, new organizations always inherit their theme from the parent organization, but having a custom theme already present can save you time when customizing and activating it for the new organization. The Folder Template in every organization contains a Themes folder and an empty default folder. Do not modify the empty default folder, but create a new theme folder instead and place your files there. Because the Folder Template does not contain an active theme, there is no Upload Theme menu option on its Themes folder. Instead create the folder for your theme and upload files as resources, or copy an entire theme folder from the parent organizations Themes folder. If you want to restrict access to the themes in created organizations, you can also set the permissions on the Themes folder in the Folder Template. To do this, follow the procedure in section 5.3.3, Restricting Access to Themes, on page 92.

5.4

Working With CSS Files

This section is not a CSS tutorial but rather a collection of tips and tricks for working with the CSS that makes up the themes in JasperReports server. This section focuses on how to test the themes you develop and match the CSS to its behavior in the JasperReports Server UI. Additionally, there are many different editors for CSS and tools for testing it, so the recommendations in this section are just one way of developing a theme.

5.4.1

Theme Development Workflow

The major choice to make when developing a theme is whether to use simple theme overrides or to duplicate and modify theme files, as described in section 5.2.3, CSS Priority Scheme and Custom Overrides, on page 89. Usually, the extent of your modifications determines which method to use. 95

JasperReports Server Administrator Guide Once you have made that determination, you are ready to create your theme. The principal steps in a theme development workflow are as follows: Step 1. 2. 3. 4. 5. 6. Download the default theme so you have a copy of the files and CSS rules that you want to modify. Create your new CSS rules, CSS files, and image files. Upload your new files to a test platform, and activate the theme or place them in an active theme. Verify your changes wherever they occur in the UI. Repeat step 2 through step 4 for all your changes until the theme is finalized. Deploy your theme to your users. Section 5.3.1, Setting the System Theme, on page 90 or 5.3.2, Setting an Organization Theme, on page 91. Reference Section 5.3.4.2, Downloading and Uploading Theme ZIP Files, on page 94. Section 5.4.2, Firebug Plug-in for Firefox, on page 96 for a tool to help you create CSS rules. Section 5.3.4.1, Creating Theme Folders and File Resources, on page 93. Sections 5.4.3, Test Platform, on page 96 and 5.4.5, User Interface Samples, on page 97.

5.4.2

Firebug Plug-in for Firefox

One tool to help you find, modify, and view CSS rules in step 2 above is the Firebug plug-in for the Mozilla Firefox browser. Firebug displays the HTML, JavaScript, and CSS rules of web pages as you browse. It has a dynamic interface that lets you select an element on the web page, and it displays the specific CSS rules that apply to the element. It also allows you to modify those rules and immediately see the effect on the web page. The Firebug tool is ideal for modifying themes in JasperReports Server. Once you locate the pages and elements that you want to modify, you can prototype your changes directly within the tool. For example, you can see overall effect of changing a color or modifying the spacing. If you are implementing your theme through custom overrides, you can copy the CSS rules from the Firebug frame directly into the overrides_custom.css file. Firebug displays the entire rule from its original file, so the copy overrides it exactly. If you are modifying other files from the default theme, Firebug show you the filename and line number of the rule, so that you can easily find it in your copy of the file. And when you are testing a theme that uses overrides, Firebug displays both the active CSS rule from overrides_custom.css and the original rule in the regular theme file of the inherited theme. The original rule is displayed in strike-through, so you can easily tell which rule is active and which rule it overrides. For more information and downloads, see the Firebug website.

5.4.3

Test Platform

When you upload a theme and make it active, it is immediately visible to every user in the organization (if using the community edition, every user on the server), or in the case of a system theme, to every user on the server. Even editing or uploading a file into an active theme is reflected immediately in the user interface. Because developing a theme requires many iterations of uploading, activating, and testing CSS rules, you shouldnt develop themes on a production server. In the simplest case, you can develop and test your themes before putting your JasperReports Server into production. As you test your server during the deployment, you can develop your themes without impacting real users. For multi-organization deployments that are in production, you can test on your production server as long as you create a test organization. The test organization inherits from the system theme, creating a very realistic test environment where you can see how your theme overrides the inherited theme. Make sure your test organization reflects your real organizations, for example having OLAP views if your real organizations perform OLAP analysis. This can help you test your theme with the elements of the user interface that your organization users see the most.

96

Themes For single-organization deployments that dont have a license to create organizations, you can test your themes on a second installation of the server. For example, you could download the evaluation copy of JasperReports Server and install it on the same computer where you develop the theme. This lets you see how your theme appears either as a system theme or in the default organization. As in the case of the test organization, test your theme with all the server features, for example the Ad Hoc Editor, Dashboard Designer, input controls on reports, scheduling, and the like. When your theme is well-tested and nearly complete, you should test it on the production server. Upload your theme to the Themes folder where you intend to deploy it, but do not activate it. Log in as a test user and add the following parameter to any URL, for example the home page URL:
&theme=<theme-name>

This activates your theme for the test user on all pages that you access until the user session times out. This allows you to navigate the entire application and see the effect of your theme in the production environment, without affecting other users.
To set the theme back to the default append the &theme parameter to the URL with the string default (&theme=default). This is especially useful if a problem with the current theme has inadvertently disabled any functionality.

On all of these test platforms, you should look at the user interface generated by your theme with the same browsers and browser versions that your users have. If you see errors, you can also use Firebug to look at the CSS rules that are involved, even if the errors do not show up on Firefox.

5.4.4

Modifying the Appearance of Jaspersoft OLAP

Jaspersoft OLAP relies on a module called jPivot to display data when performing OLAP analysis. The jPivot module does not use all of the features of the new UI framework, but it supports some customizations through themes. For example, it does not use panels that can be hidden, and images for icons are not stored in a theme. However, some display characteristics of the analysis table are controlled by the theme, through the use of the analysisView ID in the theme file dataDisplays.css. For example, you can change the lines between cells in the analysis table with the following rule in your overrides_custom.css file:
#analysisView td { border: thin solid black; }

5.4.5

User Interface Samples

When testing your theme, you should look at its effect across all pages and dialogs of JasperReports Server. Your test organization and test users should access all the features of the server to view the user interface under all conditions. An additional test is to look at the user interface samples with the theme you are developing. The user interface sample page is a new page included with the redesign of the interface. It is only accessible to administrators: 1. 2. 3. 4. Log in as administrator in your test environment at the level where you want to test your theme (superuser or
jasperadmin of an organization or suborganization).

If you havent already done so, upload your theme to the Themes folder at this level. See section 5.3.4, Creating Theme Folders and Files, on page 93. Select View > UI Samples from the main menu on any page. Look at all the sample components in each of the sample galleries. For example, the buttons gallery shows all the different types of buttons in every possible action state.

97

JasperReports Server Administrator Guide

Figure 5-8 5.

All Possible Button Components in the Sample Galleries

When you click on the standard layouts, the sample replaces the samples page. Select View > UI Samples from the main menu again to return to the galleries.
The samples page relies on an extra CSS file that is not required in a theme, but that can be included. The file samples.css is located in the default theme in the system-level Themes folder. If the sample elements do not appear as you expect, add this file to your theme and customize its rules as necessary. The rules in this file are not used anywhere else in the user interface, so it should not be included in your final theme.

Viewing the sample galleries can help you quickly find errors in your theme, especially if you are changing many rules and replacing entire files in your theme. Using these samples along with the testing procedures and tools described previously, you can verify that your theme properly implements the custom user interface that you intend. Having a well-tested theme minimizes the chances of errors when you activate the theme in your production server.

98

Import/Export

CHAPTER 6

IMPORT/EXPORT

This section describes functionality that can be restricted by the software license for JasperReports Server. If you dont see some of the options described in this section, your license may prohibit you from using them. To find out what you're licensed to use, or to upgrade your license, contact Jaspersoft.

The import and export tools enable you to extract resources from, or add resources to, a JasperReports Server repository. The utilities also handle scheduled jobs, users, and roles that the server stores internally. Import and export can be helpful when migrating between versions of JasperReports Server or when moving between test and production environments. As of version 5.0, JasperReports Server provides both a user interface and command-line utilities to perform import and export. The user interface is available only to system admins (superuser by default) and the command-line utilities require access to the file system where the server is installed. This chapter contains the following sections:

Import and Export Catalogs Exporting from the User Interface Importing from the User Interface Command-Line Utilities Exporting From the Command Line Importing From the Command Line

6.1

Import and Export Catalogs

The output of the export command, and input to the import command, is called a catalog. It is a set of folders and files that represent the contents of the servers internal database, including organizations, users, roles, scheduled jobs, and repository resources such as reports and associated files. The catalog can be exported either as a hierarchy of folders and files, or as a single zip file containing the same information. Regardless of the catalog format, the contents of the catalog are not intended for external access. Objects in the database, such as users, roles, and folders, are described in XML files, and repository resources are stored in various private formats consisting of data files and subfolders. The XML syntax of the files is not publicly defined, and the data files arent meant to be accessed.
User passwords are encrypted in the servers internal database, but not in exported catalogs. Take appropriate measures to secure the catalog file from unauthorized access if you export users.

99

JasperReports Server Administrator Guide

6.2
1. 2.

Exporting from the User Interface

The server settings pages for system administrators include a user interface to easily export resources, users, and roles from the JasperReports Server repository. Log in as system administrator (superuser by default). Select Manage > Server Settings and choose Export in the left-hand panel.

Figure 6-1 3. 4.

User Interface for Export

Specify the name of the zip file for the exported catalog. In order to download the catalog, the web UI supports only the zip archive format. Use the check boxes and multi-select lists to choose the contents of your exported catalog file:

Check Export Everything to export the entire repository, including permissions and report jobs, as well as all organizations, users, and roles. Check the box for Include access events if you want to include resource modification times.
This web UI does not allow you to export individual resources (URIs) from the repository. To export individual resources, see section 6.5, Exporting From the Command Line, on page 102.

Clear the box for Export Everything and select only users and roles to export. Check Include users with selected roles if you wish to select only roles and the users who have them. In either case, you can check Include audit events and Include monitoring events separately.

5.

Click Export. The server generates the catalog zip file and your browser prompts you to save the file. Depending on the size of your repository and the options youve selected, it may take several minutes to generate the catalog file.
User passwords are encrypted in the servers internal database, but not in exported catalogs. Take appropriate measures to secure the catalog file from unauthorized access if you export users.

100

Import/Export

6.3

Importing from the User Interface

The Settings pages for system administrators include a user interface to simplify the import procedure. This import operates on a running instance of the server, and all imported resources are visible immediately. In addition, any configuration or security settings in the imported catalog take effect immediately, without requiring you to restart the server. 1. 2. Log in as system administrator (superuser by default). Select Manage > Server Settings and choose Import in the left-hand panel.

Figure 6-2 3. 4.

User Interface for Import

Click Browse to choose the catalog zip file to import. The web UI supports only the zip archive format, however, you can import any catalog zip file created by the export UI or the command-line export utility. Use the check boxes to change the behavior of the import operation:

When checked, the Update option will import only resources that are newer than ones with the same URI in the current repository. The Skip user updates option allows you to keep the current definition of any users that also exist in the imported catalog. When checked, the Include access events option imports the modification times of resources from the catalog. When cleared, resources keep their existing access times if they already exist. The Include audit events and Include monitoring events determine whether access and monitoring events from the catalog, if any, are imported. The Include server settings option determines whether the system configuration is updated from the catalog. There are two pre-requisites in order for the catalog to contain configuration settings:

The originating server settings must be modified through the UI. Thus, only Log Settings, Ad Hoc Settings, Ad Hoc Cache, and OLAP Settings are affected. For more information, see section 7.1, Configuration Settings in the User Interface, on page 108. The catalog must be exported with the everything option from the user interface or the command-line utility.

When server settings are imported, they take effect immediately. The new settings can be seen and modified on the corresponding settings pages listed in the left-hand panel. 5. Click Import. The server uploads the catalog zip file and imports its contents into the repository. Depending on the size of the catalog and the options youve selected, it may take several minutes to perform the import.

101

JasperReports Server Administrator Guide

6.4

Command-Line Utilities
<js-install>\buildomatic\js-import.bat <js-install>\buildomatic\js-export.bat <js-install>/buildomatic/js-import.sh <js-install>/buildomatic/js-export.sh

The import and export utilities are shell scripts located in the <js-install>/buildomatic folder: Windows: Linux:

The examples in this chapter use the shortened Windows commands without the optional .bat extension on the command line. If you are running JasperReports Server in Linux, be sure to add the .sh file extension. When using the import and export utilities, keep in mind the following:

JasperReports server should be stopped when using the import and export utilities. This is very important for the import utility to avoid issues with caches, configuration, and security. All command line options start with two dashes (--). You must specify either a directory or a zip file to export to or import from. Make sure the output location specified for an export is writable to the user running the command. All URIs are repository paths originating at the root. The repository paths shown in this chapter assume you are using a commercial edition of the server. In the community edition, paths dont include organizations, for example: Commercial editions: /organizations/organization_1/reports/samples/AllAccounts Community project: /reports/samples/AllAccounts

6.5

Exporting From the Command Line


Jaspersoft recommends you stop your server instance before running the export utility. For instructions see the JasperReports Server Installation Guide.

Usage: js-export [OPTIONS]

Specifies repository resources such as reports, images, folders, and scheduled jobs to export to the file system. You can also export the internal definitions for scheduled jobs, users, roles, as well existing audit data. The export output is known as a repository catalog; it is either an archive file or a set of files in a folder structure: Table 6-1 Option
--everything

Options in js-export Command Explanation


Export everything except audit and monitoring data: all repository resources, permissions, report jobs, users, and roles. If any server settings have been modified in the UI, those are included as well. This option is equivalent to: --uris --repository-permissions --report-jobs --users --roles

--help --include-access-events --output-dir --output-zip --report-jobs

Displays brief information about the available options. Access events (date, time, and user name of last modification) are exported. Path of a directory in which to create the output catalog folder. Path and filename of the output catalog zip file to create. Comma separated list of repository report unit and folder URIs for which report unit jobs should be exported. For a folder URI, this option exports the scheduled jobs of all reports in the folder and recursively in all subfolders.

102

Import/Export Table 6-1 Option


--repository-permissions

Options in js-export Command, continued Explanation


When this option is present, repository permissions are exported along with each exported folder and resource. This option should only be used in conjunction with --uris.

--roles --role-users --uris --users

Comma separated list of roles to export; if no roles are specified with this option, all roles are exported. When this option is present, each role export triggers the export of all users belonging to the role. This option should only be used in conjunction with --roles. Comma separated list of folder or resource URIs in the repository. Comma separated list of users to export; if no users are specified with this options, all users are exported. Exporting a user includes all user attributes and, in order to maintain consistency, also exports all roles assigned to the user. When specifying users, you must give their organization ID if applicable, for example: --users superuser, "jasperadmin|organization_1", ... Include audit data for all resources and users in the export. Include monitoring data for all resources and users in the export.

--include-audit-events --include-monitoring-events

User passwords are encrypted in the servers internal database, but not in exported catalogs. Take appropriate measures to secure the catalog file from unauthorized access if you export users.

Examples:

Export everything in the repository:


js-export --everything --output-dir myExport

Export the /reports/samples/AllAccounts report unit to a catalog folder:


js-export --uris /organizations/organization_1/reports/samples/AllAccounts --output-dir myExport

Export the /images and /fonts folders:


js-export --uris /organizations/organization_1/images,/organizations/organization_1/ reports --output-dir myExport

Export all resources (except users, roles, and job schedules) and their permissions to a zip catalog:
js-export --uris / --repository-permissions --output-zip myExport.zip

Export all resources and report jobs:


js-export --uris / --report-jobs / --output-dir myExport

Export the report jobs of the /reports/samples/AllAccounts report unit:


js-export --report-jobs /organizations/organization_1/reports/samples/AllAccounts --output-dir myExport Export all roles and users: js-export --roles --users --output-dir myExport

Export the ROLE_USER and ROLE_ADMINISTRATOR roles along with all users belonging to either role:
js-export --roles ROLE_USER, ROLE_ADMINISTRATOR --role-users --output-dir myExport

The --uris option allows you to specify one or more resource URIs. A URI can specify a resource such as a report. In this case, all associated resources (such as images, subreports, data sources, resource bundles, and class files) are exported. A URI can also specify a folder. If a folder is specified, the export operation exports all resources and folders contained in the folder. In addition, it recurses through all its subfolders.
The folder named Temp at the root and in every organization is a special folder. None of the folders or resources in a Temp folder are exported.

103

JasperReports Server Administrator Guide

6.6

Importing From the Command Line


When using the js-import command line utility, the server must be stopped to avoid issues with caches, configuration, and security. For instructions see the JasperReports Server Installation Guide.

See section 6.4, Command-Line Utilities, on page 102 for guidelines when running the command-line utilities.

Usage: js-import [OPTIONS] Reads a repository catalog from the your file system and creates the named resource in the JasperReports Server repository. The repository catalog must have been created by the export interface or the js-export command, either as a ZIP archive file or a solder structure: Table 6-2 Option
--help --input-dir --input-zip --update --skip-user-update --include-access-events --include-audit-events --include-monitoring-events --include-server-settings

Options in js-import Command Explanation


Displays brief information about the available options. Path for importing a catalog from a directory. Path and filename for importing a catalog from a zip file. Resources in the catalog replace those in the repository if their URIs and types match. When used with --update, users in the catalog are not imported or updated. Use this option to import catalogs without overwriting currently defined users. Restores access events (date, time, and username of last modification) on imported resources. Professional edition only. Imports any audit data that exists in the catalog. Professional edition only. Imports any monitoring data that exists in the catalog. Determines whether the system configuration is updated from the catalog. There are two pre-requisites in order for the catalog to contain configuration settings:
The originating server settings must be modified through the UI (Log Settings, Ad

Hoc Settings, Ad Hoc Cache, and OLAP Settings). For more information, see 7.1, Configuration Settings in the User Interface, on page 108.
The catalog must be exported with the everything option from the user interface

or the command-line utility. When server settings are imported, they take effect as soon as the server is started.

Examples:

Import the myExport.zip catalog archive file:


js-import --input-zip myExport.zip

Import the myDir catalog folder, replacing existing resources if their URIs and types match those found in the catalog:
js-import --input-dir myDir --update

Import the myExport.zip catalog archive file but ignore any users found in the catalog:
js-import --input-zip myExport.zip --update --skip-user-update

Import the myDir catalog folder with access events:


js-import --input-dir myDir --include-access-events

The default behavior when a resource is found in the target repository that has the same URI as the resource that you are attempting to import is to skip the creation operation and leave the existing resource unchanged (no overwrite occurs). To delete the existing resource and replace it with a new one (of the same type and with the same URI), use the --update option. Note that, if the resource in the export catalog is of a different type than the existing resource, the server returns an error and skips the update operation.

104

Import/Export When you import a user, if its roles exist in the repository, the user is given these roles. User properties are imported with the user. When you import access events, the date and time of the last modification before export is restored on import for every resource. The catalog folder must have been created with access events. If you do not import access events, or if they dont exist in the imported files, the date and time of the import are used.

105

JasperReports Server Administrator Guide

106

System Configuration

CHAPTER 7

SYSTEM CONFIGURATION

You can change the default behavior of JasperReports Server by editing the systems configuration. The configuration is defined by a set of properties with a given value. The configuration properties are stored in two locations:

All properties are stored in configuration files located in various folders under the <js-install> directory, which is the root of your JasperReports Server installation. To change the configuration, you edit these files and then restart the server. A few of the most commonly edited properties are available to the system admin through the JasperReports Server user interface. Changes to these properties take effect immediately and override the equivalent values stored in files. A new feature of version 5.0 stores these configuration properties in the repository so that they are permanently set, even if the server is restarted.

This chapter describes a subset of the properties in the configuration files. Configuration of the auditing feature is covered in section 8.2, Configuring Auditing and Monitoring, on page 143. More options are described in the JasperReports Server Installation Guide. Because the locations of files described in this chapter vary with your application server, the paths specified in this chapter are relative to the deployed WAR file for the application. For example, the applicationContext.xml file is shown as residing in the WEB-INF folder; if you use the Tomcat application server bundled with the installer, the default path to this location is: C:\Program Files\jasperreports-server-4.7\apache-tomcat\webapps\jasperserver-pro\WEB-INF
Use caution when editing the properties described in this chapter. Inadvertent changes may cause unexpected errors throughout JasperReports Server that may be difficult to troubleshoot. Before changing any files, back them up to a location outside of your JasperReports Server installation. Configuration files contain many settings that are not documented here. Even though some settings may appear straightforward, values other than the default may not work properly and cause errors. Do not modify settings that are not described in the documentation. This section describes functionality that can be restricted by the software license for JasperReports Server. If you dont see some of the options described in this section, your license may prohibit you from using them. To find out what you're licensed to use, or to upgrade your license, contact Jaspersoft.

This chapter includes:


Configuration Settings in the User Interface Configuring User Password Options Configuring the User Session Timeout Configuring Password Memory Encrypting the Repository Database Password Encrypting User Session Login Configuring CSRF Prevention 107

JasperReports Server Administrator Guide


Configuring Input Validation Defining a Cross-Domain Policy for Flash Configuring Ad Hoc Enabling Data Snapshots Configuring System Logs Disabling the Domain Validation Check Configuring JasperReports Library Configuring the Heartbeat Removing Report Scheduling Interval Options Special Domain Support Configuring the Online Help

7.1

Configuration Settings in the User Interface

As of version 5.0, changes to configuration settings in the JasperReports Server user interfaces are persistent through server restarts. Previously, changes to setting in the user interface would not be stored, and upon restart, configuration settings would revert to values stored in the configuration files.
To make persistent configuration changes through the JasperReports Server user interface:

1. 2.

Log in as system administrator (superuser by default). Select Manage > Server Settings:

3.

Choose a category of settings or administrator actions from the left-hand panel of the Settings:

Figure 7-1

The User Interface for Configuration Settings

108

System Configuration 4. Find the configuration setting you wish to change and edit its value. In the case of log levels, the new value takes effect immediately. In the case of other settings, click Change beside the individual setting. These settings and administrator actions are documented in their respective sections: Settings
Log Settings Ad Hoc Settings Ad Hoc Cache OLAP Settings Import Export

Documentation
Section 7.12, Configuring System Logs, on page 129 Section 7.10.1, Ad Hoc Settings, on page 121 Section 7.10.3, Managing the Ad Hoc Cache, on page 124 Jaspersoft OLAP User Guide Section 6.3, Importing from the User Interface, on page 101 Section 6.2, Exporting from the User Interface, on page 100

When viewing or modifying configuration settings that appear in the user interface (Log Settings, Ad Hoc Settings, and OLAP Settings), keep in mind the following guidelines:

The Settings pages display a subset of the configuration settings that are available in configuration files. Therefore, all settings in the UI also exist in a configuration file. By default, the Settings pages display the values of settings that exist in the corresponding configuration file. When you change a value on the Settings pages, the new value is not written to the corresponding configuration file. Instead, it is stored in a special resource in the repository, called the GlobalPropertiesList. The GlobalPropertiesList is located in the System Properties folder at the root of the repository is only visible to the system admin (superuser by default).

Figure 7-2

The System Properties Folder Visible to System Admins

Not all configuration settings from the Server Settings pages are stored in the GlobalPropertiesList. Only those that have a value modified through the Settings pages are stored and made persistent.

When the server restarts, the values in the GlobalPropertiesList take precedence over values for the same settings in the configuration files, and they are in effect as soon as the server starts up. The Settings pages display the values of settings that are in effect on the server. Therefore, settings in the GlobalPropertiesList appear on the Settings pages where they can be changed again if necessary. As a result, a configuration value in the GlobalPropertiesList is most likely to be different from its corresponding value in a configuration file.
Be aware that the configuration values that appear on the Settings pages are possibly a mixture of values loaded from configuration files and from the persistent GlobalPropertiesList.

109

JasperReports Server Administrator Guide

Right-click the GlobalPropertiesList and select Edit to view the configuration values it stores. Jaspersoft does not recommend modifying this list of values directly.

Figure 7-3

The GlobalPropertiesList Containing Persistent Configuration Settings

Storing configuration values in the GlobalPropertiesList in the repository makes it possible to export them to different servers or re-import them after a server upgrade. For more information, see section 6.3, Importing from the User Interface, on page 101.

7.2

Configuring User Password Options

The user password options determine whether users may change their own passwords, and whether the change is mandatory or optional.
By default, passwords are stored in an encrypted format in the servers private database. For information about how to change the way passwords are encrypted, refer to the JasperReports Server Installation Guide.

7.2.1

Enabling Password Expiration

If your security policies require your users to change their passwords at regular intervals, you can enable password expiration. In this case, JasperReports Server prompts users to change their passwords at the interval you specify. For example, if you set the password expiry to 90 days, the server prompts your users to change their passwords every three months. When a users password expires, the user cannot log in until she changes her password. The default value is 0; in this case, passwords dont expire and users are never prompted. When this option is enabled, the server automatically enables the Change Password option on the Login page, even if allowUserPasswordChange is set to false.
If your users are externally-authenticated, for example with LDAP, do not enable this option.

Password Administration Option Configuration File


\WEB-INF\jasperserver-servlet.xml (controls the Login page) \WEB-INF\applicationContext-security-web.xml (controls web services)

110

System Configuration Password Administration Option, continued Property


passwordExpirationInDays

Value
0 <default> <any other value>

Description
Set the value to any positive, non-zero value to specify the number of days after which a password expires.

7.2.2

Allowing Users to Change their Passwords

To allow users to change their passwords, this setting option makes the Change Password link that appears on the Login page. By default, this option is false, and an administrator must define user passwords initially or reset a forgotten password. Enabling the password expiration option (described in the previous section) automatically enables the ability of users to change their passwords.
If your users are externally authenticated, for example with LDAP, do not enable this option.

Password Administration Option Configuration File


\WEB-INF\jasperserver-servlet.xml

Property
allowUserPasswordChange

Value
false <default> true

Description
Set the value to true to enable the Change Password link. Any other value disables it.

7.3

Configuring the User Session Timeout

The user session timeout is the length of time a users session can remain inactive before the server automatically logs the user out. JasperReports Server now implements a pop-up reminder that tells users their session is about to expire and gives them the chance to continue without being logged out. User Session Timeout Configuration File
\WEB-INF\web.xml

Property
<session-config> <session-timeout>

Value
20 <default>

Description
Set the number of minutes that a user session can remain idle before automatic logout. Set the value to 0 (zero) to prevent sessions from ever timing out.

Note that the session timeout also applies to how long a session remains in memory after a web services call finishes. If there is another web service call with the same credentials within the timeout period, the server reuses the same session. If the timeout is too short for this case, you may have performance issues caused by a high load of web service calls. Conversely, if the timeout is too long, a user session may stay active for a long time (even indefinitely with a timeout of 0) if a user leaves his browser open. The risk of allowing long sessions is that the in-memory session is not updated with any role changes until the user logs out manually (ending the session) and logs in again (creating a new session).

111

JasperReports Server Administrator Guide

7.4

Configuring Password Memory

Most browsers have a feature to remember passwords that stores passwords for the user. JasperReports Server can send the property autocomplete="off" to indicate that its users passwords should not be stored or filled in automatically. Users must then type in their full username and password every time they log in. As a general security policy, sensitive passwords should not be stored in browsers. Most browsers do not protect the passwords with a master password by default, which makes them vulnerable. Setting autocomplete to off helps ensure that JasperReports Server users do not store their passwords, thus avoiding this possible security risk. Actual behavior depends on the users browser settings and how the browser responds to the autocomplete="off" property. Login encryption described in section 7.6, Encrypting User Session Login, on page 113 is not compatible with password memory in the browser. Independently of the autocomplete setting, the JavaScript that implements the login encryption clears the password field before submitting the page. As a result, most browsers will not prompt to remember the password when login encryption is enabled, even if the user has password memory enabled in his browser.
When autoCompleteLoginForm is true, as in the default installation, you should ensure that all of your users have a master password in their browser.

Password Memory in the Browser Configuration File


\WEB-INF\jasperserver-servlet.xml

Property
autoCompleteLoginForm

Value
true <default> false

Description
When false, the server sets autocomplete="off" on the login page and browsers will not fill in or prompt to save Jaspersoft passwords. When true, the autocomplete property is not sent at all, and browser behavior depends on user settings.

7.5

Encrypting the Repository Database Password

The repository is stored as a private database that only JasperReports Server may access. The import and export utilities also access this database using the configuration settings in the file <js-install>/buildomatic/build_conf/default/js.jdbc.properties. In this file, the metadata.jdbc.password property displays the password to access the repository database in clear text. If the file permissions on your system are not sufficient, you may want to encrypt this password for added security.
To encrypt the repository database password:

1. 2.

Navigate to the <js-install>/buildomatic directory. Run the utility js-encrypt-pass in one of the following ways: a. b. Use the --pass <password> option on the command line, for example: % js-encrypt-pass.bat --pass myPassword Edit the js-encrypt-pass.bat or js-encrypt-pass.sh file and modify the script to add the following line:
export CMD_LINE_ARGS=" --pass myPassword"

Then, when you run the script, the password does not appear on the command line: % js-encrypt-pass.bat 3. The utility encrypts <password> and displays the encryption key:
Encrypting password: myPassword Add next string to js.jdbc.properties: metadata.jdbc.encryptedPassword=0x08,0x5a,0xf1,0x6d,0x96,0x13,0x3f,0x16,0xf2,0xd8

112

System Configuration 4. In the file <js-install>/buildomatic/build_conf/default/js.jdbc.properties, replace the metadata.jdbc.password property and value with the property and value that were output in the previous step. In this example, replace the line:
metadata.jdbc.password=myPassword

With the following line:


metadata.jdbc.encryptedPassword=0x08,0x5a,0xf1,0x6d,0x96,0x13,0x3f,0x16,0xf2,0xd8

5.

If you added the password to the script in step b above, be sure to edit the file again to remove it.

7.6

Encrypting User Session Login

By default, JasperReports Server does not enable the Secure Socket Layer/Transport Layer Security (SSL/TLS) to encrypt all data between the browser and the server, also known as HTTPS. Enabling HTTPS, as documented in the JasperReports Server Ultimate Guide, requires a certificate and a careful configuration of your servers. Jaspersoft recommends implementing HTTPS but recognizes that it is not always feasible. Without HTTPS, all data sent by the user, including passwords, appear unencrypted in the network traffic. Because passwords should never be visible, JasperReports Server provides an independent mechanism for encrypting the password values without using HTTPS. The encryption mechanism is used in the following cases:

Passwords sent from the login page. Passwords sent from the change password dialog (see section 7.2, Configuring User Password Options, on page 110). Passwords sent from the user management pages by an administrator.

When a browser requests one of these pages, the server generates a private-public key pair and sends the public key along with the page. A JavaScript in the requested page encrypts the password when the user posts it to the server. Meanwhile, the server saves its private key and uses it to decrypt the password when it arrives. After decrypting the password, the server continues with the usual authentication methods. Login encryption is not compatible with password memory in the browser. Independently of the autocomplete setting described in section 7.4, Configuring Password Memory, on page 112, the JavaScript that implements login encryption clears the password field before submitting the page. As a result, most browsers will never prompt to remember the encrypted password. The disadvantage of login encryption is the added processing and the added complexity of web services login. For backward compatibility, login encryption is disabled by default. To enable login encryption, set the following properties. After making any changes, redeploy the JasperReports Server webapp or restart the application server.
When login encryption is enabled, web services and URL parameters must also send encrypted passwords. Your applications must first obtain the key from the server and then encrypt the password before sending it. See the JasperReports Server Web Services Guide and JasperReports Server Ultimate Guide, respectively.

Login Encryption Configuration File


\WEB-INF\classes\esapi\security-config.properties

Property
encryption.on

Value
true false <default> RSA <default>

Description
Turns login encryption on or off. Encryption is off by default. Any other value besides caseinsensitive false is equivalent to true. Encryption algorithm; currently, only RSA is supported.

encryption.type

113

JasperReports Server Administrator Guide Login Encryption, continued


encryption.key.length integer power of 2 1024 <default> true <default> false The length of the generated encryption keys. This affects the strength of encryption and the length of the encrypted string. When true, a key will be generated per every single request. When false, the key will be generated once per application installation. See descriptions in Dynamic Key Encryption and Static Key Encryption below.

encryption.dynamic.key

Encryption has two modes, dynamic and static, as determined by the encryption.dynamic.key parameter. These modes provide different levels of security and are further described in the following sections.

7.6.1

Dynamic Key Encryption

The advantage of encrypting the password at login is to prevent it from being seen, but also to prevent it from being used. For password encryption to achieve this, the password must be encrypted differently every time it is sent. With dynamic key encryption, the server uses a new public-private key pair with every login request. Every time someone logs in, the server generates a new key pair and sends the new public key to the JavaScript on the page that sends the password. This ensures that the encrypted password is different every time it is sent, and a potential attacker won't be able to steal the encrypted password to log in or send a different request. Because it is more secure, dynamic key encryption is the default setting when encryption is enabled. The disadvantage of dynamic keys is that generating keys slows down each login, though it is not usually visible to users. Another effect of dynamic key encryption is that it does not allow remembering passwords in the browser. While this may be an inconvenience, it is actually more secure to not store passwords in the browser (where they may be compromised) and require typing in the password for every login (because computers can be stolen). See section 7.4, Configuring Password Memory, on page 112.

7.6.2

Static Key Encryption

However, if dynamic key encryption is not desired, JasperReports Server also supports static key encryption. In this case, a unique key pair is generated automatically on the first user login and remains the same for the entire server installation. Because the key is always the same, the encrypted value of a users password is always the same. This means that an attacker could steal the encrypted password and use it to access the server. Static key encryption is very insecure and is recommended only for intranet server installation where the network traffic is more protected. The only advantage of static encryption over no encryption at all is that passwords cannot be deciphered and used to attack other systems where users might have the same password. Before setting encryption.dynamic.key=false to use static encryption, you must also configure the secure file called keystore where the key pair is kept. Be sure to customize the keystore parameters listed in the following table to make your keystore file more unique and secure.
For security reasons, always change the default keystore passwords immediately after installing the server.

Keystore Configuration (when encryption.dynamic.key=false) Configuration File


\WEB-INF\classes\esapi\security-config.properties

Property

Value

Description

114

System Configuration Keystore Configuration (when encryption.dynamic.key=false), continued


keystore.location keystore.jks <default> Path and filename of the keystore file. This parameter is either an absolute path or a file in the webapp classpath, for example <tomcat>/ webapps/jasperserver-pro/WEB-INF/classes>. By default, the keystore.jks file is shipped with the server and doesnt contains any keys. Password for the whole keystore file. This password is used to verify keystore's integrity. Name by which the single key is retrieved from keystore. If a new alias is specified and does not correspond to an existing key, a new key will be generated and inserted into the keystore. Password for the key whose alias is specified by keystore.key.alias.

keystore.password

jasper123 <default> jasper <default>

keystore.key.alias

keystore.key.password

jasper321 <default>

When changing the key alias, the old key will not be deleted; it can be used again by resetting the key alias. Also, once key has been created with a password, you cannot change the password through the keystore configuration. To delete keys or change a keystore password, the server administrator must use the Java keytool.exe utility in the bin directory of the JRE or JDK. If you change the keystore password or the key password, the keystore configuration above must reflect the new values or login will fail for all users.

7.7

Configuring CSRF Prevention

Cross-Site Request Forgery (CSRF) is an exploit where the attacker impersonates a valid user session to gain information or perform actions on behalf of the attacker. In JasperReports Server, the security framework protects all administration pages under the Manage menu with a CSRF token in the post header, for example:
JASPER_CSRF_TOKEN: BVSY-UBBJ-K8E9-L4NZ-5866-Z4P2-ZG75-KKBW-U53Z-I833-V0OJ-BRK5-OFG5-ZL6X

In the default configuration of the server, CSRF prevention active. Jaspersoft does not recommend changing this setting: CSRF Prevention Configuration File
\WEB-INF\classes\esapi\security-config.properties

Property
security.validation.csrf.on

Value
true <default> false

Description
Turns CSRF prevention on or off. By default, CSRF prevention is on. Any other value besides case-insensitive false is equivalent to true.

7.8

Configuring Input Validation

To block potential security threats such as cross-site scripting and SQL injection, the security framework has a powerful mechanism to validate all user input and values passed to reports. Input validation prevents values with dangerous side-effects such as malicious scripts and queries. Administrators can monitor the server logs to search for evidence of attempted security breaches. However, input that was allowed in previous version of the server may be blocked, and users may see errors when entering values. In particular:

115

JasperReports Server Administrator Guide


Parameter names and values cannot have tags (< and >). If your business data contains tags, you need to update the security configuration to allow them. SQL queries should start with SELECT and cannot have comments. Multiple queries separated by semi-colons (;) are also prohibited. If your reports or Domains have such queries, you need to either change them or update the security configuration to allow them.

If users see recurring errors, administrators can examine logs to determine what input is not allowed. Preferably, users should modify their input to remove special characters that are security risks. If that is not feasible, administrators can configure the security framework to modify security rules or turn off the security restrictions, based on their perceived threat level.
Input validation rules were added to comply with security guidelines for web applications. Turning off input validation or modifying the validation rules may make the server more vulnerable to web attacks.

Input validation is a complex mechanism that is configured in the following files: File
<js-webapp>/WEB-INF/classes/esapi/ security-config.properties <js-webapp>/WEB-INF/bundles/ security.properties <js-webapp>/WEB-INF/classes/esapi/ security.properties <js-webapp>/WEB-INF/classes/esapi/ validation.properties

Contents
Top-level configuration for enabling or disabling input validation. Text of validation error messages shown to users. Defines the input validation rules for each field of the servers web pages and report input. Defines the regular expressions used in security rules.

Input validation is based on UTF-8 encoded input. Make sure your application server is configured for UTF-8 URIs as described in section C.2, UTF-8 Configuration, on page 167.

Input validation is enabled by default when installing JasperReports Server. To turn off one or more of the protection features: Input Validation Configuration File
\WEB-INF\classes\esapi\security-config.properties

Property
security.validation.input.on

Value
true <default> false true <default> false

Description
Turns field input validation on or off for the server web application. Any other value besides caseinsensitive false is equivalent to true. Turns SQL query validation on or off in the server. Any other value besides case-insensitive false is equivalent to true.

security.validation.sql.on

7.8.1

Customizing Security Error Messages

When input validation blocks input that violates a security rule, the server displays an error. By default, the security messages are intentionally generic so that potential attackers are not aware that they have triggered a security error. Jaspersoft highly recommends that external deployments customize the security error messages to be unique, yet still generic. You can change both the message and the error number. Choose any combination of numbers or letters so that administrators can easily search the logs to detect security violations.

116

System Configuration Input Validation Messages Configuration File


\WEB-INF\bundles\security.properties

Property
message.validation.input

Value
An error has occurred. Please contact your system administrator. (5321) <default> An error has occurred. Please contact your system administrator. (6632) <default>

message.validation.sql

Set these properties to messages and error codes that match the rest of your application. The goal is to display a message that attackers will not recognize as a security error, yet that administrators can uniquely identify in the logs. If you translate your application into other languages, be sure to create a locale-specific copy of this file and translate these messages as well.

7.8.2

Configuring Input Validation Rules

Input validation rules determine what input is allowed when users send information to the server. This information generally consists of parameter-value pairs, for example the fields of an input form. For each known parameter-value pair, an input validation rule defines the following:

What characters are allowed in the parameter name. What characters are allowed in the input value. The maximum allowable length for the parameter name and the input value (the same limit applies to both separately). Whether the value can be blank.

Allowed characters are determined by a regular expression called a validator. Validators are named regular expressions that can be used in any number of input validation rules. Even though validators can be used in several rules, each validation rule should be as specific as possible to the allowable input. 7.8.2.1 Editing Input Validation Rules

The predefined input validation rules in JasperReports Server are designed to allow all data and normal user input, while blocking potential attacks on the server. If your data or your user input causes security errors (false positives), you may choose to modify the input validation rules to allow your input. 1. Locate the "SECURITY FAILURE" message in your logs that was created by the security error. For more information about logs, see section 7.12, Configuring System Logs, on page 129. The log message contains the name of the parameter and context where the parameter was used. Make a backup copy of the file <js-webapp>/WEB-INF/classes/esapi/security.properties, then open it for editing. Locate the parameter name and context. For example, this is the input validation rule for the entities parameter on the Manage Roles page:
entities=Alpha,AlphaNumPunctuation,5000,true,entities-Manage_Roles_context

2. 3.

The input validation rule has the following format: <parameter>=<nameValidator>,[!]<valueValidator>,<charLimit>,<blankAllowed>,<parameter>-<context>_context 4. Modify the rule to allow your input: a. Usually, you need to change the value validator to one that allows your input characters. Select a value validator from the file <js-webapp>/WEB-INF/classes/esapi/validation.properties that allows your input, or create one as described in the next section. If your input is untypically long, increase the character limit. Do not change any other part of the rule.

b. c. 5.

Save your changes and redeploy the JasperReports Server webapp, or restart your application server.

Recommendations: 117

JasperReports Server Administrator Guide


Try to keep the character limit as close to the expected value as possible. Try to use a validator that is as close to the expected values as possible. If a parameter's value is expected to be numbers only, then use the Numeric validator. Most validators are whitelists that specify character patterns that are allowed. A validator may be preceded by an exclamation mark (!) to indicate that everything but those values are permitted. When used with a validator that matches characters or words, this syntax implements a blacklist. Some rules are easier to define as whitelists, others as blacklists. If a parameter can have radically different values or the same parameter is used in different situations, then you can apply more than one rule to that parameter. To do this, simply copy a parameter rule and add incremental integers to the parameter name. For example:
standAlone=Alpha,Alpha,50,true,standAlone-Report_PopupMenu_context

Updated to:
standAlone=Alpha,AlphaNum,50,true,standAlone-Report_PopupMenu1of3_context standAlone2=Alpha,JSONObject,50000,true,standAlone-Report_PopupMenu2of3_context standAlone3=Alpha,JSONArray,500000,true,standAlone-Report_PopupMenu3of3_context With multiple rules for the same parameter, each rule is applied in the order listed until one passes (equivalent to a logical OR). If they all fail, then the input is blocked and the user is notified with the generic error message. The rules that fail still appear as security warnings in the logs. Use numbering in the context names, as shown above, to easily identify these false-positive messages. When using multiple rules, define the most used rule or the most permissive rule first to optimize the validation and reduce false-positive log messages.

7.8.2.2

Creating Validator Expressions

The validators are Java-based regular expressions that specify which characters are allowed (whitelist) or forbidden (blacklist), depending on how it is used in a validation rule.
Do not modify the default validator expressions provided with the server. These expressions have been thoroughly tested by Jaspersoft to provide reasonable input validation security while allowing for the general use of the application. Also, a validator can be used in several input validation rules, so modifying them may have unintended consequences. You should always create new validators with new names.

1. 2.

Make a backup copy of the file <js-webapp>/WEB-INF/classes/esapi/validation.properties, then open it for editing. Locate the validator used in the input validation rule you wish to modify, for example the Alpha validator expression allows for any letters in any language:
Validator.Alpha=^[\\p{L}\\p{M}]*$

3.

Copy the entire rule on a new line and give it a new name with the following format: Validator.<validatorName>=<regularExpression> Remember to use double backslashes (\\) in properties files for single backslashes in the expression. You should also use the \p{} syntax to match international letters and their accent marks, for example:
Validator.AlphaDotSpace=^[\\p{L}\\p{M}\\.\\s]*$

4. 5.

Use the new value validator name in your input validation rule, as described in the previous procedure. Save your changes and redeploy the JasperReports Server webapp, or restart your application server. Validating New Input Parameters

7.8.2.3

If you customize JasperReports Server to accept new input parameters, you must add the corresponding input validation rules in order to maintain server security. 1. 2. Make a backup copy of the file *<js-webapp>/WEB-INF/classes/esapi/security.properties*, then open it for editing. Create a new input validation rule that has the following format: <parameter>=<nameValidator>,<valueValidator>,<charLimit>,<blankAllowed>,<parameter>-<context>_context The context is the string that will appear in the log when a security validation error occurs, so it should contain the exact parameter name.

118

System Configuration 3. Look at existing rules in the file <js-webapp>/WEB-INF/classes/esapi/validation.properties to find validators for the parameter name and value that allow your new input. If necessary, create new validator expressions as described in the previous procedure. Save your changes and redeploy the JasperReports Server webapp, or restart your application server.

4.

7.8.3

Query Validation

Query validation is a special case of input validation, where the server ensures that all queries being issued by the server meet a preset pattern for a safe query. When query validation is enabled, all queries in reports and Domains use the following validator:
Validator.ValidSQL=^\\s*((?i)select)\\s+[^;]+$

As a result:

SQL comments are forbidden. Ensure that you have only one executable query statement per query. Multiple queries separated by semi-colons (;) will be rejected. The following example will cause a security error:
SELECT f1,f2 FROM tbl_1 WHERE f1=f2; SELCT f3 from tbl_2;

Queries for reports must retrieve data only, in other words, only use the SELECT statement. The following statements are forbidden:
DROP, INSERT, UPDATE, DELETE

If you wish to use stored procedures, you must add the following validator to the file <js-webapp>/WEB-INF/classes/ esapi/validation.properties:
Validator.ValidSPROC=^\\s*\\(((?i)call)\\s+[^;]+\\)$

And then modify the validation rule for the corresponding parameter or field where you wish to allow stored procedure calls. If you want to allow stored procedure calls in addition to select statements, specify multiple validation rules as shown in section 7.8.2.1, Editing Input Validation Rules, on page 117.

When SQL validation fails, the logs contain the message described in section 7.8.1, Customizing Security Error Messages, on page 116, such as the following:
2011-11-21 13:54:28,007 ERROR ValidatorImpl,"http-bio-8090"-exec-12:48 - An error has occurred. Please contact your system administrator. (6632) org.owasp.esapi.errors.ValidationException: SQL_Query_Executor_context: Invalid input. Please conform to regex ^\s*((?i)select)\s+[^;]+$ with a maximum length of 50000

7.8.4

Further Configuration

The configuration files contain some miscellaneous default settings for the security framework. In particular they define default action for input that has no validation rules. Changing these defaults is possible but not recommended: Advanced Input Validation Configuration File
\WEB-INF\classes\esapi\security-config.properties

Property
log.msg.security.off

Default Value
SECURITY for [%s] is OFF

Description
If security is turned OFF, this message will be logged. This message in the logs can alert administrators if the security configuration has been tampered with. If a request parameter is not previously known, this message is logged. If there is an error in the security configuration files, this message is logged. This is a severe error and should be resolved by the administrator.

msg.no.rule

No rule for parameter [%s]. Using default validation on input=[%s]. Security configuration [%s] cannot be loaded.

msg.cannot.load

119

JasperReports Server Administrator Guide Advanced Input Validation, continued Configuration File
\WEB-INF\classes\esapi\security.properties

Property
DEFAULT

Default Value
Alpha,AlphaNumPunct uationBrackets,2000 00,true,DEFAULT

Description
If an input parameter does not have any defined validation rule, this validation rule is applied. The validator for values, AlphaNumPunctuationBrackets is fairly permissive, and can be changed to something more restrictive. The DEFAULT property name is a keyword and should never be changed.

7.9

Defining a Cross-Domain Policy for Flash

For security reasons, a Flash animation playing in a web browser is not allowed to access data that resides outside the exact web domain from which the SWF originated. JasperReports Server uses Flash for the advanced Fusion-based charts such as gauges and maps. As a result, even servers in subdomains cannot share data with a server in the parent domain unless they define a cross-domain policy that explicitly allows it. The file crossdomain.xml, located at the root of the server that contains the data, defines what domains may access the data without prompting the user to grant access in a security dialog. Therefore, the server where the data is located determines which other servers may access the data. The following crossdomain.xml sample only allows access from the example domain or any of its subdomains. This example is saying that the server with this file only trusts example.com to use its data.
<?xml version="1.0" ?> <!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd"> <cross-domain-policy> <allow-access-from domain="example.com" /> <allow-access-from domain="*.example.com" /> </cross-domain-policy>

Behind a firewall, servers and users often refer to other computers in the same domain without using the domain name. Flash considers this a different domain and blocks access to data unless the computer name is given in the policy:
<cross-domain-policy> <allow-access-from domain="myserver.example.com" /> <allow-access-from domain="myserver" /> </cross-domain-policy>

120

System Configuration When using web services, use the allow-http-request-headers-from element so that actions encoded in the request header are allowed. The following example allows standard requests and web service requests from any subdomain of example.com.
<cross-domain-policy> <site-control permitted-cross-domain-policies="master-only"/> <allow-access-from domain="*.example.com"/> <allow-http-request-headers-from domain="*.example.com" headers="*" secure="true"/> </cross-domain-policy>

For a description of all possible properties, see the cross-domain policy file specification. To define a cross-domain policy for Flash-based reports, create a file such as the ones above on the server that contains the data being accessed. Be sure to place the crossdomain.xml file at the root of the filespace that is being served. For example, if you use Apache Tomcat, place your files in the following locations: File
crossdomain.xml XML data (*.xml) Flash component (*.swf)

Location
<website-B-tomcat-dir>/webapps/ROOT/crossdomain.xml <website-B-tomcat-dir>/webapps/ROOT/<any-dir>/*.xml <website-A-tomcat-dir>/webapps/<appname>/<any-dir>

7.10

Configuring Ad Hoc

Ad Hoc functionality is only available to JasperReports Server professional edition users. Ad Hoc settings help you fine-tune the Ad Hoc Editor and the views it creates. You must be logged in as a user with ROLE_SUPERUSER to manage the Ad Hoc settings and cache. This section includes:

Ad Hoc Settings Ad Hoc Editor Configuration File Options Managing the Ad Hoc Cache Configuring Ad Hoc OLAP Filters

7.10.1

Ad Hoc Settings
The Ad Hoc settings apply to Ad Hoc views based on Topics or Domains. Ad Hoc views based on OLAP connections use the OLAP settings described in the Jaspersoft OLAP User Guide.

The Ad Hoc settings limit the resources available for queries when Ad Hoc views are designed and run. The options are:

Ad Hoc Filter List of Values Row Limit. The maximum number of items that should be displayed in the Condition Editor when a user defines filters for an Ad Hoc view that is based on a Domain. If this limit is exceeded when users define filters, JasperReports Server displays a message to that effect. Setting this to a lower value can improve performance. Ad Hoc Dataset Row Limit. The maximum number of rows that an Ad Hoc view can return. JasperReports Server truncates the data when the limit is reached. Setting this to a lower number may improve performance, but your reports may not reflect the full data set. Ad Hoc Query Timeout. The number of seconds the server should wait before timing out an Ad Hoc view while running its query. Setting this to a lower number may prevent exceptions from being displayed to users when they run Ad Hoc views. Setting this to a higher number may prevent complex calculations from timing out, but it results in the use of more database connections.

121

JasperReports Server Administrator Guide 7.10.1.1 Configuring the Ad Hoc Settings

As of JasperReports Server version 5.0, Ad Hoc settings made through the user interface are persistent, even when the server is restarted. For details, see section 7.1, Configuration Settings in the User Interface, on page 108. To set Ad Hoc settings in JasperReports Server:

1. 2. 3. 4. 5. 6.

Log in as system administrator (superuser by default). Select Manage > Server Settings and choose Ad Hoc Settings in the left-hand panel. In the Ad Hoc Filter List of Values Row Limit field, enter the maximum number of items to display in the Condition Editor when a user defines filters for an Ad Hoc report based on a Domain. In the Ad Hoc Dataset Row Limit field, enter the maximum number of rows that an Ad Hoc view can return. In the Ad Hoc Query Timeout (seconds) field, enter the number of seconds the server should wait before timing out an Ad Hoc report while running its query. Click Save to make your changes effective. Or click Reset to return to the previously saved values. Understanding Data Policies

7.10.1.2

Data snapshots, described in sections 3.2.4 on page 39 and 7.11 on page 128, apply only to reports displayed in the report viewer. This section covers data policies that only apply to views in the Ad Hoc Editor.

Data policies determine how JasperReports Server handles data loading and processing for certain kinds of Ad Hoc views. They determine how data is cached and where certain calculations occur. For example, you can specify that the data accessed by Domain-based reports is grouped, sorted, and aggregated in the database rather than having the server process it in memory. By default, the server relies on the database to group, sort, and aggregate data returned by queries based on Domains when it is feasible. It also forces the server to only retrieve the fields that appear in the report (rather than the entire set of fields in the Domain). For queries based on JDBC data sources, such processing occurs in memory, and the entire result set defined in the Topic is returned. Note that independent check boxes control the behavior: one for Domains and another for JDBC data sources. When these settings are disabled, the server loads the entire set of fields associated with a Domain or Topic into memory, and then applies the necessary grouping, sorting, and aggregation. This is also the case for Ad Hoc views that do not rely on Domains or JDBC data sources; in these cases, the server processes the data in memory. Generally, Jaspersoft recommends that these settings be enabled, especially when working with large datasets. In deciding whether JasperReports Server should process the data in memory or push that processing to the database, consider these factors:

The size and complexity of your reports. Reports with complex sorting, grouping, or aggregation may perform better when the server optimizes the queries. The amount of data in your data sources. If your data sources include a great deal of data, reports against them may perform better when the server optimizes the queries. The number of users editing and running Ad Hoc views. If you have a large number of users creating and running Ad Hoc views, performance may be better when the server optimizes the queries. Implementations with fewer users may perform better when the options are disabled. The performance characteristics of your data source. If the database or other source of data is tuned for maximum performance, Ad Hoc views may perform better when the server optimizes the queries. Note that, if your data source is hosted by MySQL, Jaspersoft recommends that you clear the check from the Optimize Queries for Domain-based Reports box. The amount of memory allocated to JasperReports Server's Java Virtual Machine (JVM). If the JVM of the application server hosting JasperReports Server is allocated plenty of memory, Ad Hoc views may perform better when JasperReports Server optimizes the queries. This is especially true if your data source tends to be slow.

To decide whether JasperReports Server should optimize queries for Ad Hoc views, Jaspersoft recommends disabling the settings, opening and saving some representative reports, and testing their performance. If the performance improves, leave the settings disabled and open and save the remaining reports.

122

System Configuration 7.10.1.3 Configuring the Data Policies

As of JasperReports Server version 5.0, Ad Hoc settings made through the user interface are persistent, even when the server is restarted. For details, see section 7.1, Configuration Settings in the User Interface, on page 108.

The data polices that you can set are:


Optimize Queries for JDBC-based Reports. Selects grouping, sorting, and aggregation of queries for JDBC-based

reports. Otherwise, the queries run unaltered in memory. Optimize Queries for Domain-based Reports. Selects grouping, sorting, and aggregation of queries for Domain-based reports. Otherwise, the queries run unaltered in memory.

To set data policies in JasperReports Server:

1. 2. 3. 4. 5.

Log in as system administrator (superuser by default). Select Manage > Server Settings and choose Ad Hoc Settings in the left-hand panel. Select Optimize Queries for JDBC-based Reports to process queries for JDBC-based reports. Select Optimize Queries for Domain-based Reports to process queries for Domain-based reports. Click Save to make your changes effective. Or click Reset to return to the previously saved values.
These data policy settings do not retroactively update the existing reports created from Ad Hoc views in your repository. To change the data policy for an existing report, select the appropriate policy setting, open the corresponding view in the Ad Hoc Editor, and save the report again.

7.10.1.4

Data Policies for Big Data

When handling large datasets (big data) from a Domain source in the Ad Hoc Editor, fields summarized by distinct count are computationally intensive. You can speed up the display of your data by requesting distinct count calculations from the data source, as opposed to performing the calculations in memory. Database servers are usually optimized for these calculations, which improves the overall performance of the Ad Hoc Editor. Ad Hoc for Big Data Configuration File
\WEB-INF\applicationContext-adhoc.xml

Property
calcMethod

Bean
DistinctCount

Description
Change this property from value="sqlGroupBy" (the default) to value="sqlUnionAll". The UnionAll is the modified query that provides distinct count computed by the database.

After making this change, redeploy the JasperReports Server webapp or restart the application server. Performing distinct count aggregates in the database applies only in the following cases:

Crosstabs based on Domains contain measures aggregated by distinct count. Tables based on Domains contain groups aggregated by distinct count, but no detail rows. There is a calculated field, for example a Groovy-based field, anywhere in the report. There is a row or column group involving a time, timestamp, or date.

This setting has no effect when:


In these cases, Ad Hoc performs the distinct count summary calculations in memory, regardless of the calcMethod setting.

123

JasperReports Server Administrator Guide

7.10.2

Ad Hoc Editor Configuration File Options


Configurable Properties in WEB-INF/applicationContext-adhoc.xml Description
The location in the file system of the state2jrxml.js script, which generates the JRXML report based on the current Ad Hoc Editor selections. By default, this file is located in the /adhoc folder of the repository. The repository location where Topics should reside. The default is /adhoc/topics. The name of the default style for Ad Hoc views. This name must match a style defined in both a CSS and a JRXML file. The default is default. The repository location where users are allowed to save their Ad Hoc views. The default is /. This allows your users to save Ad Hoc views anywhere. If you have a folder specifically for user content, specify this folder; for example, /userviews. The repository location where JasperReports Server saves reports created from Ad Hoc views. The default is /temp relative to root and to every organization. The server allows users with ROLE_ADMINISTRATOR or ROLE_SUPERUSER to view the temporary folders and their contents. The server manages these temporary files automatically, but files may accumulate in certain cases. As part of regular maintenance, you should periodically delete the files in these folders.

The following properties are among those that can be configured in the WEB-INF/applicationContext-adhoc.xml file: Table 7-1 Property
JrxmlScriptURI

realmsURI defaultTheme

aruFolder

tempFolderName

maxSafeGroupMembers

The maximum number of row groups or column groups a crosstab can display before the editor prompts the user for confirmation. This limit is a safeguard to avoid performance issues when grouping a field with too many values. The default is 100. Set it higher to allow more groups to appear without prompting users.

The repository URI locations are relative to each and every organization in the server instance. For example, for a user in the default organization, the URI /adhoc actually refers to /organizations/organization_1/adhoc.

7.10.3

Managing the Ad Hoc Cache


The Ad Hoc cache applies to Ad Hoc reports based on Topics or Domains. Ad Hoc reports based on OLAP connections use the OLAP cache. For a comparison of the two caches, see section 7.10.3.4, Comparison with Jaspersoft OLAP, on page 127. For instructions on setting the OLAP cache, see the Jaspersoft OLAP User Guide.

JasperReports Server can temporarily cache ad hoc query result sets for re-use. The cache is populated by the data that results from queries when creating or running Ad Hoc views. The datasets are uniquely identified by a key that references the query itself, the data source URI, and parameters used when the query was issued. Caching reduces database loads and delivers frequently-used datasets to the user quickly. Caching applies when reports are created as well as when they are run. JasperReport Server version 5.0 introduces a new cache implementation called Ehcache that allows the administrator to view cache entry memory size and set limits on memory usage. You can configure the Ad Hoc cache to optimize memory usage and response time for your usage patterns. 7.10.3.1 Setting the Cache Granularity

By default, datasets for each user are cached separately; a parameter in the cache key identifies the user. This per-user caching can result in duplicate datasets when different users run the same query, impairing performance. You can configure JasperReports Server to share cached datasets across users by editing the \WEB-INF\applicationContext-datarator.xml file.

124

System Configuration The following code configures the cacheKeyInterceptor bean to ignore logged-in users credentials when creating the cache keys:
<property name=ignoredParameters> <list> ... <value>LoggedInUser</value> <value>LoggedInUsername</value> </list> </property>

Restart JasperReports Server after adding the code. 7.10.3.2 Configuring the Cache

Caching improves overall performance of data retrieval and sorting, but unused datasets can consume memory and cached data can become stale. To address these concerns, the cache automatically removes datasets periodically. By default, datasets are removed from the cache if they are not accessed for 30 minutes. They are also cleared after 90 minutes, regardless of how recently they were accessed. To configure the frequency with which the cache is automatically cleared, edit the following configuration file: Ad Hoc Cache Expiration Configuration File
\WEB-INF\adhoc-ehcache.xml

Property
maxBytesLocalHeap

Default Value
300m

Description
The maximum memory usage of the entire cache, by default 300 MB. Set this value according to your servers available memory, the size of your typical and largest datasets, and the number of cache entries you expect based on the time settings below. Use k for kilobytes, m for megabytes, and g for gigabytes. The number of seconds to wait after a dataset is has been accessed before removing it from the cache. The default is 30 minutes. Use 0 (zero) for no limit. The maximum time that a dataset is stored in the cache, even if it is being repeatedly accessed. Ensures that stale data is periodically replaced. The default is 90 minutes. Use 0 (zero) for no limit.

timeToIdleSeconds

1800

timeToLiveSeconds

5400

Restart JasperReports Server after modifying these values. 7.10.3.3 Manually Clearing the Cache

Administrators can also use the server interface to view the queries whose datasets are in the cache. Administrators can see the full query but never the contents of the dataset. The Ad Hoc cache page also displays performance data about each query. This information can be helpful when trying to resolve performance issues. The interface displays several values for every query:

Query (msec) Time in milliseconds from when query was sent to the data source (database) until the first row was received. Fetch (msec) Time in milliseconds from when first row was received from the data source (database) until the last row was received Memory used (MB) Size in megabytes of the resulting dataset being stored in the cache entry.

125

JasperReports Server Administrator Guide The Ad Hoc cache page also allows administrators to manually remove datasets if necessary. Removing a dataset from the cache forces the server to get fresh data the next time a user creates or runs an Ad Hoc view with that query.
To view queries and manually clear the Ad Hoc cache:

1. 2.

In JasperReports Server, log in as system administrator (superuser by default). Click Manage > Server Settings and choose Ad Hoc Cache in the left-hand panel. The Ad Hoc Cache page appears, displaying all the datasets that are in the cache, sorted by age.

Figure 7-4

Ad Hoc Dataset Caching Administration Page

As shown in Figure 7-4, each dataset is listed by its corresponding query and data source. Recall that Ad Hoc Topics have user-defined queries, so they tend to be short, whereas the query for Domains are generated from the design of the Domain and user selections in the Data Chooser dialog. The Ad Hoc Cache page only displays the first few lines of a query, as well as the data source. 3. To view the details of a specific query, including the full query string, click it in the Query & Source column. The Detail page appears, displaying additional information for the selected query, such as the number of rows in the cached dataset.

126

System Configuration

Figure 7-5 4. 5.

Typical Dataset in Ad Hoc Cache

To remove a dataset from the cache, close the Detail dialog if necessary, and click Clear beside the corresponding query. To remove all datasets, click Clear All at the top of the Ad Hoc Cache page. Comparison with Jaspersoft OLAP Ad Hoc Caching in JasperReports Server and Jaspersoft OLAP JasperReports Server
Result caches are held at the query level: query text and language, plus data source URI and query parameters. Not by default, but can be enabled as described in section 7.10.3.1 above.

7.10.3.4 Table 7-2

The following table contrasts the key features of the Ad Hoc cache in JasperReports Server and Jaspersoft OLAP.

Cache Feature
Structure of cache

Jaspersoft OLAP
Result caches are held at the analysis connection level: schema plus database connection. There is only one cache; it is shared across all queries and users.

Sharing Security Populating Size

Applied to cache control so that users are not allowed to see privileged data. Queries populate the cache. You can also schedule reports to pre-populate the cache during off-hours. Limited by available JVM memory (heap). Not configurable. Running out of memory is unusual. It can only happen if a single query returns too many elements for available memory. The report fails with an out-of-memory error.

Automatic timebased cache policy

Configurable, as described in section 7.10.3.2 above.

In low-memory situations, cached items are removed automatically by JVM garbage collection; the least-recently-used items are cleared first. There is no way to remove data based on how long it has been in memory. Cache regions can be defined and cleared programmatically with APIs. In JasperReports Server, select Manage > Server Settings, then select OLAP Settings and click Flush OLAP Cache. For additional methods, see the Jaspersoft OLAP Ultimate Guide.

Clearing selected datasets manually Clearing all datasets manually

Configurable, as described in section 7.10.3.3 above. Configurable, as described in section 7.10.3.3 above.

127

JasperReports Server Administrator Guide 7.10.3.5 Disabling the Ad Hoc Cache

Disabling either cache is a server-wide setting that applies to all data sources or connections used in any Ad Hoc view. Make sure that other views arent negatively affected by this change.

There are two reasons to consider disabling the Ad Hoc cache:


You have a high-performance database that returns results so fast that additional caching in the server does not improve response times. In this case, the slight overhead of the cache may actually impact performance. Your database manages real-time data, and you create Ad Hoc views that present up-to-the-minute information from this data source. In this case, you do not want to retrieve old data out of the cache.

To disable the Ad Hoc cache for Topics and Domains, set the value of maxBytesLocalHeap to 1 (1 byte). For instructions, see section 7.10.3.2, Configuring the Cache, on page 125. This effectively turns off the cache so that every query is retrieved directly from the data source. To disable the OLAP cache for OLAP connections used in the Ad Hoc Editor, check the mondrian.rolap.star.disableCaching setting on the Manage > Server Settings > OLAP Settings page. For more information, see the Jaspersoft OLAP User Guide. In addition, if you have modified any of these three properties in applicationContext-adhoc.xml, set them back to false:
<property name="applyQueryFilterInMemory" value="false"/> <property name="applySecurityFilterInMemory" value="false"/> <property name="applyDynamicFilterInMemory" value="false"/>

7.10.4

Configuring Ad Hoc OLAP Filters

When using filters in Ad Hoc OLAP, the server queries the database to display a list of values to select from. To avoid performance issues, there is a limit on the number of items in a filter. By default, the limit is 250 possible values. If your filters reach this limit and your list of values is truncated, you should first consider using a different filter operation. For example, instead of city is one of <list>, use City starts with <letter>. If you still need to change this limit, modify the following property: Ad Hoc OLAP Filter Limit Configuration File
\WEB-INF\applicationContext-adhoc.xml

Property
maxFilterValues

Bean
mdxDataStrategy

Description
Set the value to the maximum number of filter values you expect. Setting this value higher than the default of 250 may cause performance issues.

7.11

Enabling Data Snapshots

The data snapshot feature was introduced in JasperReports Server release 4.7 to store report data in the server. Data snapshots create a significant change in the user experience:

Without data snapshots Whenever users run a report, the server queries the data source and displays the latest data. When the same report is run over and over, the data source is often returning the same data each and every time. This is the behavior of all releases prior to 4.7, and the default behavior of release 4.7. With data snapshots The first time a report runs, it queries the data source and stores a copy of the data with the report in the repository. Users who view the report later see the data from the saved snapshot, not from querying the data source. Reports accessed through web service APIs are also based on the saved snapshot. For large reports or frequently viewed reports, the persisted snapshot provides a significant performance gain and reduces load on your data sources. Every user who has access to the report will see the data from the same snapshot. For users who require it, the report viewer provides

128

System Configuration a button to manually refresh the data snapshot anytime. In addition, when the scheduler runs a job on a report it always updates the snapshot. Data snapshots are implemented in JasperReports Server 4.7, but must be enabled manually. Jaspersoft recommends enabling data snapshots at the server level in the following cases:

If you have a new installation of JasperReports Server 4.7, then enable snapshots to get the full server functionality. In the future, persistent data snapshots may be enabled by default. If you are upgrading to release 4.7, first proceed with the upgrade procedure and verify the outcome, as instructed in the JasperReports Server Installation Guide. Then, before enabling data snapshots, notify your users about this new functionality.

The server-level settings allows you to use data snapshots globally, on every report that does not explicitly disable them at the report level. The following property controls the data snapshot functionality: Data Snapshots Server-Level Configuration Configuration File
\WEB-INF\applicationContext-data-snapshots.xml

Property
snapshotPersistence Enabled

Bean
dataSnapshot Service

Description
When set to true, it allows the JasperReports Server report viewer to save data snapshots in the repository and open them the next time the report is run. By default, this is set to false. Data snapshots are stored in the servers repository, which must be sized accordingly. If you have a large number of reports, or very large reports, consider the performance of your repository database before enabling snapshots. If your users rely on data that changes frequently or if they expect to see real-time data when opening a report, do not enable this property.

There is also a property named snapshotRecordingEnabled that caches a snapshot in the report viewer memory when sorting and filtering columns interactively. This allows the report viewer to refresh the display without querying the database every time. Regardless of persistence, snapshotRecordingEnabled improves report viewing performance and decreases database load, and thus should remain set to true.

At the report level, report writers may explicitly enable or disable data snapshots by setting the following property in the reports JRXML. The report-level property take precedence over the server-level property. The behavior and limitations are the same as for the server-level setting above:
net.sf.jasperreports.data.cache.persistable=true or false This report-level property depends on the snapshot mechanism in JasperReports Server. This property has no effect in other report viewers without such a mechanism, such as the viewer integrated in Jaspersoft iReport.

7.12

Configuring System Logs

This section describes the settings that control the information JasperReports Server writes to its logs. The log files contain important information about how the server is running. JasperReports Server uses the Apache log4j package to generate log files. Jaspersoft uses the slf4j facade to wrap log4j.

The default log file is WEB-INF\logs\jasperserver.log. The default log configuration file is WEB-INF\log4j.properties.

129

JasperReports Server Administrator Guide

7.12.1
1. 2. 3.

Managing Log Settings

To set the current logging levels:

Log in as system administrator (superuser by default). Select Manage > Server Settings and choose Log Settings in the left-hand panel. On the Log Settings page, use the drop-down selectors to change the log level for each class being logged.

Figure 7-6

System Log Settings

The page lists some of the currently-enabled loggers (ones that typically need their logging levels adjusted from time to time) with their logging level. By selecting values from the drop-downs on the page, you can change the logging levels without restarting JasperReports Server.
These logging levels override the levels in the log4j.properties file. As of JasperReports Server version 5.0, these settings will persist even when the server is restarted. Therefore the values on the Log Settings page that are in effect on the server may differ from settings in the log4j.properties file.

The four logging levels indicate the type of event that is recorded by a logger: Setting
ERROR WARN INFO DEBUG

Level of Information
Writes minimal information to the log describing serious program faults. Writes error and warning messages to the log. Warning messages contain cautionary information to help you to decide whether the logged events require your attention. Writes error, warning, and informational messages to the log. Informational messages describe significant events, such as those that affect application performance. Writes error, warning, informational, and additional messages to the log. Debug messages are very detailed and often voluminous. Use this setting only to diagnose a problem. DEBUG can impact system performance and should not be used in production environments. If several loggers are set to DEBUG, the server may generate huge logs, and performance can suffer.

JasperReports Servers default root logger setting is ERROR, as configured in log4j.properties. A logger that does not have an assigned value inherits the setting of its parent in log4j.properties.

130

System Configuration The following table lists each logger name as it appears on the Log Settings page, the identifier to use to find a particular log in the log file, and a description of the logger. Logger Name
SQL query executer Input control value queries Cascading input control parameter resolution

Identifier in log
JRJdbcQueryExe cuter valueQueryLog FilterCore

Description
Logs SQL text and parameter values for queries that are run by the SQL query executer. Logs SQL text and parameter values for queries associated with input controls. Logs activity associated with cascading input controls. Query-driven input controls can cascade when a query has a parameter whose value comes from another input control. When the parameter value is changed, the query is automatically rerun, possibly changing the list of values for its input control. Logs use of the cache for results of cascading input control queries. Logs SQL run by the Hibernate layer to access the JasperReports Server repository database. This logger generates a large volume of logging that could affect performance. Logs various activities of the Ad Hoc data policy implementations, which use SQL queries or in-memory operations to get datasets for Ad Hoc views. Logs SQL queries generated from queries using a Domain. Logs use of JDBC connections used by Domains to run SQL queries. Logs information about the conversion between DomEL and JSON, which is used by Ad Hoc filters. Logs activity related to Domain column- and row-level security. Logs the same activity as the FilterCore logger (Cascading input control parameter resolution) above, but adds information specific to Domain queries. Logs information about the life cycle of datasets that are cached in memory when Ad Hoc views are accessed. Logs the time it takes a query run by the SQL query executer to return data to a report. Logs activity for the WorkingDataSet, used by the Ad Hoc Editor to perform in-memory dataset transformations of query results. Logs activity of the Ad Hoc Editor. Logs additional activity of the Ad Hoc Editor specific to crosstab reports. Logs Groovy classes generated from DomEL expressions used by the Ad Hoc Editor for filters and calculated fields.

Cascading input control query result caching Hibernate SQL

TokenControlLogic

SQL

Ad Hoc data policy logging

CommonDomainDataStrategy SubFilterInputControlGenerator Others

SQL generated for Domain queries Connection handling for Domains Expression to JSON converter Domain-based security tests Cascading input control resolution for Domains Ad Hoc cache activity Timing for SQL queries run for reports Ad Hoc WorkingDataSet General controller Crosstab controller Groovy code generation for memory datasets

JdbcBaseDataSet DataSourceResolverImpl ExpressionJSON Converter SemanticLayerSecurityResolver Impl DomainFilterResolver

CachedData JsControlledJdbcQueryExecuter WorkingDataSet

AdhocAjaxController AdhocCrosstabAjaxController GroovyGenerator

131

JasperReports Server Administrator Guide Logger Name


Ad Hoc AJAX requests

Identifier in log
adhocAjaxRequests

Description
Logs information about AJAX requests made by Ad Hoc Editor and dashboard designer, including report parameters and response times. Enable this setting when you want to understand the Ad Hoc Editor and dashboard designer or if youve encountered an error or slow response times. Tracks the life cycle of datasets managed by the Ad Hoc cache as they transition between states. This log output includes information from the Ad Hoc cache in a format that lends itself to troubleshooting. Use this setting to understand how query response times contribute to the performance and responsiveness of the Ad Hoc Editor. Because it doesn't log the queries themselves, use it in conjunction with the SQL Query Executer log setting.

Ad Hoc cache activity

com.jaspersoft.commons. datarator.CachedData

You can add other loggers to the Log Settings page if you know their classnames.
To add a logger to the page from the web interface:

1. 2. 3. 4. 5.

Log in as system administrator (superuser by default). Select Manage > Server Settings and choose Log Settings in the left-hand panel. Scroll to the bottom of the page. Enter the loggers classname in the text field. See the other properties on the page for guidance, for example:
com.jaspersoft.ji.adhoc.action.AdhocCrosstabAjaxController

Use the drop-down to set the logging level.

The logger setting is persistent even when the server is restarted. However, the logger setting may not appear on the Log Settings page again. For information about adding loggers to this page permanently, see Adding a Logger to the Log Settings Page on page 133.

7.12.2

Log Configuration Files

Edit the log configuration file to set loggers, logging levels, and log output. Unlike changes made in the web interface, changes made directly to the log configuration files are persistent. Restart the server for your changes to take effect. Logger names are defined in the Java source. Loggers can have any name, but the Jaspersoft convention is to give them their full class names. In the log4j properties file, the classname must be preceded by log4j.logger. For example, the classname org.acegisecurity.intercept is represented in the log4j.poperties file as log4j.logger.org.acegisecurity.intercept is org.acegisecurity.intercept. If you want to add a new logger, find its classname in the source. 7.12.2.1 Configuring Logging Options

Depending on your whether you are configuring server logging or logging during import and export, edit a different file. Functionality to Log
Import/Export JasperReports Server

File Location
<js-install>\buildomatic\conf_source\iePro WEB-INF\log4j.properties in the JasperReports Server installation

If the logger is defined in the configuration file but is commented out, simply remove the comment character (#) to add the logger. Otherwise, add the loggers classname and set it to the desired logging level. The form of a logger definition should be:
log4j.logger.<logger-classname> = <log-level>, <output-type>

where: 132

System Configuration

<logger-classname> is the name of the class you want to monitor. <log-level> is ERROR, WARN, INFO, or DEBUG <output-type> is a standard output type, such as stdout. For example: log4j.logger.org.springframework.webflow=DEBUG, stdout, fileout

Restart the server for your changes to take effect. 7.12.2.2 Adding a Logger to the Log Settings Page

If you know of a log4j logger that JasperReports Server uses, you can add it to the Log Settings page available to the superuser. To add a logger, edit a configuration file.
Because editing text files can be error-prone, Jaspersoft recommends that you add loggers from the web interface by entering them into the text field on the Log Settings page. Only edit the configuration file if you need to permanently add the logger. To edit the list of loggers to be displayed on the page:

1. 2.

Edit the logger_descriptions_pro.properties file found under WEB-INF/bundles in your JasperReports Server installation. Add a new line and specify the loggers classname and a brief description of it. Entries should be in the form <logger-classname> = <description>. See the other properties in the file for guidance, for example:
com.jaspersoft.ji.adhoc.action.AdhocCrosstabAjaxController = Crosstab controller

3.

Restart the server for your changes to take effect.


The logger_descriptions_pro.properties file controls the labels for the English locale. You can specify labels for other locales by editing the logger description property file for that locale. For example, to add the label in French, add an entry to the logger_descriptions_pro_fr.properties file. For more information on supporting other languages, refer to Localization on page 167.

7.13

Disabling the Domain Validation Check

Domains are only available to JasperReports Server professional edition. By default, JasperReports Server validates a Domain against its data source to ensure that the Domain design maps properly to the underlying tables. This validation occurs when a Domain design file is uploaded to the server. If your data source is very large and complex, this validation can be time consuming. If the validation takes too long, you can disable it. In this case, JasperReports Server assumes the Domain design is valid, and simply uploads it without the check. You can disable the validation by editing the following configuration file: Login Page Administration Options Configuration File
\WEB-INF\applicationContext-semanticLayer.xml

Property
skipDomainDatabaseValidation

Bean
slConfig

Description
By default, this property is set to FALSE; in this case, JasperReports Server validates Domain designs against their data sources. Set it to TRUE to disable this validation check.

If the tables and fields referenced in the Domain design dont exist in the data source when skipDomainDatabaseValidation is set to TRUE, the Domain wizard wont detect the problem, but the Choose Data wizard returns errors when your end users work use the Domain.

133

JasperReports Server Administrator Guide

7.14

Configuring JasperReports Library

JasperReports Servers reporting features are built on the JasperReports Library, which is embedded in the server. Many of the options you can configure to change the servers functionality are actually JasperReports Library options. The configuration options can control many aspects of JasperReports Server behavior, from the way reports are exported into different file formats, to the default font to use. These options can be set at different levels of granularity: Global (applies to all reports generated by the server), Report (defined in the JRXML and applies to a specific report), and Element (defined in the JRXML and applies to specific elements of the report). Global properties are defined in the WEB-INF/classes/jasperreports.properties file. For more information about JasperReports Library configuration, see http://jasperreports.sourceforge.net/ config.reference.html. The following sections highlight a few of the available options:

Extending JasperReports Library Changing the Crosstab Limit Setting a Global Chart Theme Enabling the XHTML or HTML Exporter Enabling Flash or HTML5 for Pro Charts

7.14.1

Extending JasperReports Library

You can extend JasperReports Library by implementing the public interfaces it exposes. Such an implementation is usually stored in a JAR (Java Archive) file that contains a file called jasperreports_extension.properties, specifies a factory class. The specified class used to instantiate an extension registry. The extension registry specifies one or more extension objects, each of which corresponds to a JasperReports Library extension point represented by a Java interface. Place this JAR on the JasperReports Library classpath, and your extension is automatically available. For more information, refer to JasperReports Ultimate Guide.

7.14.2

Changing the Crosstab Limit

If you use crosstab reports, you may experience Out of Memory errors if the reports are very large or complex. You can configure JasperReports Server to return a message instead of memory errors when users run such crosstabs. To do so, enable the net.sf.jasperreports.crosstab.bucket.measure.limit property and set its maximum value. To do so, edit the following configuration file: Crosstab Report Configuration Option Configuration File
\WEB-INF\classes\jasperreports.properties

Property
net.sf.jasperreports.crosstab. bucket.measure.limit

Description
This value represents the maximum number of cells multiplied by the number of measures in the crosstab. The default value is 100000. Enter large values to allow your users to create larger, more complicated crosstabs; enter small values to restrict them. If you experience OutOfMemoryExceptions after changing this value, try setting it to a smaller number, or configure your JVM to allow more memory to be used.

134

System Configuration

7.14.3

Setting a Global Chart Theme

Chart themes control the look and feel of the charts generated by JasperReports Server. Chart themes can be applied at the level of either the server or the individual report:

To apply a theme at the report level, select it when designing the report in Jaspersoft iReport Designer. Note that you can also apply a theme to individual chart elements, as well. Note that a chart theme can be included in a report unit as a resource; in this case, the theme is only available to charts in that report unit. To apply a theme at the server level, copy the chart theme JAR to the correct location and edit its configuration file.

A chart theme is a JAR file that defines the look and feel of a chart. Once you have created the chart theme JAR file, copy it to the WEB-INF\lib directory. Chart themes in this location are available to any chart in the instance of the server; they may also be set as the global chart theme. To set a theme as the default chart theme, edit the following configuration file: Global Report Theme Configuration File
\WEB-INF\classes\jasperreports.properties

Property
net.sf.jasperreports.chart.ChartTheme

Description
The name of a chart theme that is in the WEB-INF\lib

directory. Jaspersoft recommends that you create your chart themes in Jaspersoft iReport Designer. Click File > New > Chart Theme, then use Jaspersoft iReport Designer to archive the new chart theme as a JAR.
Chart themes do not apply to Ad Hoc chart views.

7.14.4

Enabling the XHTML or HTML Exporter

By default, JasperReports Server exports to HTML format using an XHTML exporter. Unlike the default exporter from previous versions of the server (html), the XHTML exporter (xhtml) is more forgiving when exporting reports that have overlapping elements. This setting affects all cases when HTML is exported, including when reports are exported from the report viewer and when they are scheduled to produce HTML output. To use the older HTML exporter in JasperReports Server, edit the following configuration file: HTML Exporters Configuration File
\WEB-INF\classes\jasperreports.properties

Property
com.jaspersoft.jasperreports.export.html.type

Description
Determines which of the HTML exporters is used. Valid values are:
xhtml is the newest HTML exporter that

handles overlapping report elements more gracefully that the html exporter.
html is the default HTML exporter in versions of

JasperReports Server prior to 4.2. Jaspersoft continues to support this exporter.

135

JasperReports Server Administrator Guide Note that the properties are mutually exclusive; you can only have one uncommented at a time.
If your reports include interactive elements, such as the table component (which supports sorting and filtering in the HTML preview), you must use the xhtml exporter in order to enable the interactive features; the html exporter doesnt support them.

7.14.5

Enabling Flash or HTML5 for Pro Charts

By default, JasperReports Server renders Pro Charts (those based on Fusion Charts) using Adobe Flash. If Flash isnt found in the client environment, the server renders the chart using HTML5, instead. For example, Pro Charts displayed on devices that run Apples iOS operating system are rendered using HTML5 because Flash isnt available. Note that not all browsers support HTML5. Note that Pro Charts are only available in the JasperReports Server professional edition. You can configure the server to default to HTML5 when rendering Pro Charts. In this case, if your browser doesnt support HTML5, the chart isnt rendered. To render Pro Charts using HTML5, edit the following configuration file: Pro Charts Renderer Configuration File
\WEB-INF\classes\jasperreports.properties

Property
com.jaspersoft.jasperreports.fusion.charts. render.type

Description
Determines which of the following renderers is used:
flash is the default renderer for Pro Charts. If

Flash isnt available, the server tries to render the chart in HTML5.
html5 is the newest renderer for Pro Charts.

Use it if you cant support Flash.

Note that this property only applies to reports that rely on Pro Charts and only affects the HTML preview and export. Typically, this property is set at the server level; to override the server-level setting for a specific Pro Chart report, you must set this property at the report level, and also specify a second property as shown:
net.sf.jasperreports.print.transfer.fusion=com.jaspersoft.jasperreports.fusion

This allows the reporting engine (JasperReports Library) to recognize the Fusion settings. If this property isnt set, the com.jaspersoft.jasperreports.fusion.charts.render.type property is ignored at the report level.

7.15

Configuring the Heartbeat

During installation (or the first time an administrator logs in), you are prompted whether to participate in Jaspersofts Heartbeat program, which reports specific information to Jaspersoft about your implementation, such as the operating system, JVM, application server, RDBMS (type and version), and JasperReports Server edition and version number. Once this option is set, you can change it by editing the following configuration file: Heartbeat Options Configuration File
\WEB-INF\applicationContext-logging.xml

136

System Configuration Heartbeat Options, continued Property


enabled

Bean
heartbeatBean

Description
When this property is set to TRUE, JasperReports Server reports information about your environment to Jaspersoft once a week. When it is set to FALSE, information is not sent.

The heartbeatBean bean also includes two other properties that control whether heartbeat data is sent to Jaspersoft:

askForPermission determines whether the administrator is prompted (the next time he logs into the web UI) about whether to allow heartbeat data to be sent. Typically, there is never cause to edit this property directly. permissionGranted indicates whether a user has granted the server permission to send Heartbeat data. Setting this property to FALSE prevents data from being sent.

7.16

Removing Report Scheduling Interval Options

When users schedule reports, they can specify that the report run periodically at regular intervals. For simple recurrence, the default interval can be expressed in days, hours, or minutes. If it is necessary to prevent users from scheduling frequent reports, you can limit the intervals to days or hours by editing the following configuration file: Scheduling Options Configuration File
...\WEB-INF\flows\reportJobBeans.xml

Section to Update
recurrenceIntervalUnits

Description
Comment out the intervals you want to disable.

To remove a temporal interval, enclose the corresponding bean in comment characters. For example, to keep users from scheduling reports at minute intervals, comment out the bean containing the INTERVAL_MINUTE field:
<!-<bean class="com.jaspersoft.jasperserver.war.dto.ByteEnum"> <property name="code"> <util:constant static-field="com.jaspersoft.jasperserver.api.engine.scheduling. domain.ReportJobSimpleTrigger.INTERVAL_MINUTE"/> </property> <property name="labelMessage"> <value>job.interval.unit.minute.label</value> </property> </bean> -->

7.17

Special Domain Support

When you use Domains with certain specific database constructs, you may need to configure JasperReports Server: Enabling Oracle Synonyms Enabling CLOB Fields Enabling Proprietary Types

137

JasperReports Server Administrator Guide

7.17.1

Enabling Oracle Synonyms

By default, Domains cannot access synonyms in an Oracle database. Set the following property to enable them. If you access your Oracle database through JNDI, you also need to configure the JNDI connection. Be aware that the Oracle metadata service works significantly slower when synonyms are in scope. Enabling Oracle Synonyms Configuration File
\WEB-INF\applicationContext-semanticLayer.xml

Property
includeSynonymForOracle

Bean
jdbcMetaConfiguration

Description
Set the value to TRUE: <value>true</value>

Configuration File
...\META-INF\context.xml

Property
accessToUnderlyingConnectionAllowed

Bean
<Resource name="jdbc/oracle"...

Description
If you use JNDI, add the following property: accessToUnderlyingConnection Allowed="true"

7.17.2

Enabling CLOB Fields

Support for CLOB (Character Large Object) fields is dependent on your database and must be enabled manually. If you want to access CLOB fields in JasperReports Server, you must set the following options according to your database. The Oracle JDBC driver implementation uses the CLOB JDBC type for CLOB fields. CLOB Support for Oracle Configuration File
\WEB-INF\applicationContext-semanticLayer.xml

Property
jdbc2JavaTypeMapping

Bean
jdbcMetaConfiguration

Description
This property contains a map of database field types to Java types. Find the line for CLOB that is commented out: <!--entry key="CLOB" value=""/--> Modify it as follows: <entry key="CLOB" value="java.lang.String"/>

The MySQL JDBC driver implementation uses either the CLOB JDBC type, the LONGVARBINARY JDBC type, or both to represent CLOB fields, depending on their length. CLOB Support for MySQL Configuration File
\WEB-INF\applicationContext-semanticLayer.xml

138

System Configuration CLOB Support for MySQL, continued Property


jdbc2JavaTypeMapping

Bean
jdbcMetaConfiguration

Description
This property contains a map of database field types to Java types. Find the following lines: <!--entry key="CLOB" value=""/--> <!--entry key="LONGVARBINARY" value=""/--> And modify them as follows: <entry key="CLOB" value="java.lang.String"/> <entry key="LONGVARBINARY" value="java.lang.String"/>

7.17.3

Enabling Proprietary Types

JasperReports Server provides a JDBC-to-Java type mapping for all standard JDBC column types for use in Domains. However, some databases have proprietary types, such as NVARCHAR2 in Oracle. You can map these types with a special configuration. As a prerequisite, the proprietary type must be logically equivalent to one of following Java classes:
java.lang.Boolean java.lang.Byte java.lang.Character java.lang.Double java.lang.Float java.lang.Integer java.lang.Long java.lang.Short java.lang.String java.math.BigDecimal java.sql.Date java.sql.Time java.sql.Timestamp java.util.Date

There are two ways to create a mapping for a proprietary type, as shown in the following table:

Modify the generic mapping for NUMERIC types. By default, any numeric type that doesnt match one of the other types is mapped to BigDecimal. Create a secondary mapping under the special OTHER key, where the secondary key can be your custom type name. Proprietary Database Type Mapping Configuration File
\WEB-INF\applicationContext-semanticLayer.xml

Properties
jdbc2JavaType Mapping

Bean
jdbcMeta Configuration

Description
To modify the generic mapping, edit this line:

<entry key="NUMERIC" value="java.math.BigDecimal"/>


Add any secondary key to the OTHER key, following this

example: <entry key="OTHER"> <map> <entry key="NVARCHAR2" value="java.lang.String"/> </map> </entry>


Java 1.6 supports java.sql.Types.NVARCHAR, therefore you

should add it as a generic mapping, not under OTHER: <entry key="NVARCHAR" value="java.lang.String"/>

139

JasperReports Server Administrator Guide

7.18

Configuring the Online Help

JasperReports Server professional edition includes an online help system that describes the web interface. If your users dont have internet connectivity, or if you dont want to provide access to this system, you can configure the server to hide the help links completely. Online Help Configuration Options Configuration File
\WEB-INF\applicationContext-webHelp.xml

Property
showHelp

Bean webHelp

Description
Determines whether the help links are displayed in the JasperReports Server web UI. Valid values are true and false. The help link appears on the login page (Online Help) as well as to the left of Logout on other pages.

hostURL

webHelp

Indicates the name of the computer hosting the web server where the help is running. The value depends on the version of JasperReports Server. Do not change this value. Defines the default page name to pass to the web server hosting the help system. The only valid value is Default_CSH.htm for this property. Maps contexts in the application to topic identifiers in the help system. Many pages in the web application are configured for context-sensitivity. When a user clicks Help on such a page, JasperReports Server loads a specific topic in the help system. The topic that appears is determined by a map in the applicationContext-webHelp.xml file. The only valid values are the defaults.

pagePrefix helpContextMap

webHelp webHelp

140

Server Diagnostics

CHAPTER 8

SERVER DIAGNOSTICS

This section describes functionality that can be restricted by the software license for JasperReports Server. If you dont see some of the options described in this section, your license may prohibit you from using them. To find out what you're licensed to use, or to upgrade your license, contact Jaspersoft.

JasperReports Server provides comprehensive diagnostics so that administrators can monitor the health and performance of the running server. In version 5.0, the server augments the audit logging with monitoring data that is easier to report against. Version 5.0 also introduces diagnostics that provide real-time information about the running server, such as memory usage. All of these tools can help you troubleshoot issues and analyze performance.

Auditing stores key events that are of interest to system administrators, such as login/logout time, user, report generated, report details, and object sizes. The audited events can be saved and moved to an archive automatically after a specified number of days. Monitoring is based on audit events and provides a multi-dimensional Domain to create Ad Hoc views. This helps you generate reports that contain key metrics such as which reports use the most resources. This allow you to find places to optimize your data sources and your reports. Diagnostics provide run-time data that gives the overall health of your server instance. For example, it includes load values such as the number of logged in user, the number of currently running reports, and the number of scheduled reports. The diagnostic data is exposed in a custom data source and can be easily viewed in a report or integrated with industry standard management consoles. Events Being Audited and Monitored Configuring Auditing and Monitoring Using the Audit Data Using the Monitoring Data Importing and Exporting Event Data Real-Time Diagnostics Exposing Diagnostics Through Jaspersofts JMX Agent Using the Diagnostic Data In Reports Excluding Diagnostic Attributes

This chapter contains the following sections:


141

JasperReports Server Administrator Guide

8.1

Events Being Audited and Monitored

In broad terms, an audit event is any atomic operation that can be recorded by the audit system. Event properties and attributes are features of the event; they can be defined internally or in custom code. Auditing and monitoring rely on the same record of events, so the audit events are also available in monitoring data sources, Domains, and reports. The following table lists the defined audit events and the information that is collected about them. For every recorded event, JasperReports Server logs the time it occurred and the user who initiated it. See the configuration file applicationContextaudit.xml for complete specification of the events. Event
Log in or log out Log in as Run report or run a subreport within any other report

Information Collected
Time and user ID (recorded for every event) User logged in as
Report referenced Data source referenced Report parameters and values Report queries (such as SQL, Domain, HQL, generated SQL) Execution start, end Query execution time* Report rendering time* Caching parameters Errors that occurred

Report schedule created, deleted, or updated Scheduled report run

Report referenced Scheduling parameters and values Report output Report delivery parameters (such as email) Same parameters as when report is run

Creating report in Ad Hoc Editor

Field added as a column Field added as a group

Resource accessed for any reason (such as view, used in report, etc.) Resource added or updated

Resource referenced Resource type Resource referenced Resource type

Resource or folder deleted Permissions added, updated, or deleted

Resource or folder referenced


Resource or folder referenced Previous permissions (before update)

User added, updated, or deleted, also user password change

User ID User name Email Enabled flag External flag Profile attributes

Role added, updated, or deleted

Role ID Role name Role organization

142

Server Diagnostics Event


Organization added, updated, or deleted

Information Collected
Organization ID Organization description

* Execution and rendering times are measured in milliseconds.

8.2

Configuring Auditing and Monitoring

The auditing and monitoring features rely on the same subsystem in JasperReports Server. The settings for configuring auditing and monitoring are both located in the WEB-INF/applicationContext-audit.xml file. The beans and properties of this file are used to enable auditing and monitoring, set the archive options, and select which events are logged.

8.2.1

Enabling Auditing and Monitoring

Because auditing and monitoring share the same subsystem, there is a master configuration setting to turn on the subsystem, and individual settings for auditing and monitoring. This allows you to turn on each feature independently, or turn off the whole subsystem to avoid any overhead from an unused feature. By default, the auditing and monitoring subsystem is off.
To enable auditing, monitoring, or both:

1. 2.

Open the file WEB-INF/applicationContext-audit.xml for editing. Locate the loggingContextProvider bean shown in the following sample:
<bean class="com.jaspersoft.jasperserver.api.common.util.spring.GenericBeanUpdater"> <property name="definition"> <bean class="com.jaspersoft.jasperserver.api.common.util.spring. GenericBeanUpdaterDefinition"> <property name="order" value="10"/> <property name="beanName" value="loggingContextProvider"/> <property name="propertyName" value="enabledLoggingTypesMap"/> <property name="operation" value="append"/> </bean> </property> <property name="value"> <map> <entry key="com.jaspersoft.jasperserver.api.logging.audit.domain. AuditEvent" value="false"/> </map> </property> <property name="valueType" value="stringMap"/> </bean>

3.

To enable the auditing and monitoring subsystem, set the value to true.

143

JasperReports Server Administrator Guide 4. Once the subsystem is enabled, you can turn on or off the auditing and monitoring independently. Enabling Auditing and Monitoring Options Configuration File
\WEB-INF\applicationContext-audit.xml

Property
isAuditPersistenceEnabled isMonitoringEnabled

Bean
auditService auditService

Description
Set this property to true to enable logging of events in the tables used by the audit Domain. Set this property to true to enable logging of events in the tables used by the monitoring Domain.

Avoid setting both properties to false. Instead, turn off the entire subsystem as described in step 2.

8.2.2

Auditing Archive Options

Archiving is a mechanism to move audit data to separate database tables. For example if you create reports for weekly or monthly server usage based on the audit Domain, you will never access audit logs older than a week or month. Because audit data can be quite large, the old data can increase the time needed to write new data and query data for your report. Archiving automatically moves audit data to separate database tables after a certain time. If you wish to create reports on historical audit data, Jaspersoft also provides a Domain to access the archived audit logs. You can also configure the audit feature to delete old archive data if you no longer need it. You should set the archiving interval to a level that balances your need to record and access audit data with your servers performance on large audit tables. Use the following configuration settings to change the archiving behavior. Auditing Archive Options Configuration File
\WEB-INF\applicationContext-audit.xml

Property
maxAuditEventAge ToArchive maxAuditEventAge cronExpression cronExpression

Bean
auditService auditService auditEventArchiverTrigger auditEventPurgerTrigger

Description
The number of days to keep audit data in the active database. The default is 30. Older data is moved to the archive. The number of days to keep the data. Older data is deleted. The default is 0 (zero), meaning that old data is never deleted. Defines the frequency of the archiving job in cron syntax. The default, 0 0 5* * ?, is every day at 5a.m. Defines the frequency of the audit delete (purge) job in cron syntax. The default, 0 0 3 * * ?, is every day at 3 a.m.

The cronExpression properties use a Quartz scheduler cron expression that specifies the repeating trigger as seconds, minutes, hour, day of month, month, day of week.

8.2.3

Events and Properties

By default, all events and properties are logged. To enable or disable logging of a given event or property, use the applicationContext-audit.xml configuration file. In the file, event types and their properties are listed under <util:map id="enabledEventsMapping">. The map has three parts:

WEB_SERVICES Event types related to accessing JasperReports Server through a web service. GUI Event types for access through the user interface.

144

Server Diagnostics

INTERNAL Event types used by the server itself, such as when running a scheduled report.
<!-- <entry key="createFolder" value="folderName,folderLabel,folderDescription" /> -->

To disable an event, comment it out. For example: To disable a property, use any of these measures:

Delete the property. For example, remove folderDescription, resulting in:


<entry key="createFolder" value="folderName,folderLabel,exception" />

Disable it with the | syntax. For example:


<entry key="createFolder" value="folderName,folderLabel,|folderDescription,exception" />

Use the all except *| syntax to specify only the disabled property. All others are recorded. For example:
<entry key="createFolder" value="*|folderDescription" />

8.3

Using the Audit Data

JasperReports Server makes the audit data available to administrators through Domains and several prepared views and reports. These are located in the /Public/Audit folder of the repository.

Figure 8-1

Audit Reports in the Repository

There are two Domains and two sets of reports created for accessing audit data:

Audit Domain and Audit Reports Use these to view the current audit data; they run against the active audit database. Audit Archive Domain and Archived Audit Reports Use these to run reports on archived data; they run against the archive database.

The contents of both Domains and reports are identicalthey differ only in the database tables that are accessed in each case. To create an Ad Hoc View based on the audit Domains, select Create > Ad Hoc View, select the Domains tab in the Data Chooser, and expand the folders to select one of the audit Domains.

145

JasperReports Server Administrator Guide

Figure 8-2

Selecting an Audit Domain to Create an Ad Hoc View

For instructions on using Domains in reports, see the Ad Hoc chapter in JasperReports Server User Guide. For documentation of Domains in general, see the Domains chapter in the same manual. The following sections explain the contents of the Domains and the reports that are provided.

8.3.1

Domain Items

The Domains expose the fields of the audit logging tables stored in the servers internal database. As with all Domains, the database tables are joined, and the fields are presented as items that can be used in Ad Hoc views. The following tables describe the items in both audit Domains (Audit Domain and Audit Archive Domain). These items correspond to the information that is recorded for each event. When creating a view based on either Domain, choose the items that correspond to the type of event you want to report on. Domain items in the following table are used in general events as well as repository events: Domain Item
Date Prop Long Value Prop Type Prop Value Time Event Type Request Type Resource Type Resource URI

Description
Date event occurred. clob value of event property, such as query. Type of event property, such as destination folder, as per event map in configuration file. string value of event property, such as folder name. Time event occurred. Type of event, such as save resource, as per event map in configuration file. Repository request type of event. Repository type of resource accessed in event. URI of repository resource.

146

Server Diagnostics Domain items in the following table are recorded for user events: Domain Item
E-mail Enabled External Full Name Password Changed Organization User Name

Description
E-mail address of event user (user at time of event). Whether event user is currently a user. Whether event user was an external user. Full name of event user. Whether event was a change of password Organization of event user. UserID of event user.

Domain items in the following table are recorded for role events: Domain Item
External Role Name Organization

Description
Whether role was defined in an external system. Name of the role in the event. Organization of the role in the event.

Domain items in the following table are recorded when a report is generated: Domain Item
Date Time Resource URI Resource Type Datasource URI Query Execution Time Report Rendering Time Report Execution Time

Description
Date the report is generated. Time the report is generated. URI of repository resource accessed for report. Repository type of resource accessed for report. URI of data source accessed for report. Time to execute the query in the database. Time to prepare query results for display. Total time to execute the report (query execution + report rendering + overhead). Overhead includes tasks such as loading repository resources (report unit, data source, etc) and obtaining a DB connection from the data source. Specification of the report query. UserID of event user. Organization of event user. Field name used in crosstab

Query User Name Organization Crosstab Group Field

8.3.2

Audit Reports and Ad Hoc Views


The audit reports and their views are blank by default, because auditing is disabled by default and no audit data exists. To view these reports, first enable auditing as described in section 8.2, Configuring Auditing and Monitoring, on page 143, then wait for user activity to generate events.

147

JasperReports Server Administrator Guide A number of Ad Hoc views based on the audit Domains are provided in the Public/Audit/Audit Reports folder. The same views and reports are also provided in the Archived Audit Reports subfolder. These reports are identical, except they use the Audit Archive Domain and run against the archived audit data. As with all audit material, these reports are visible only to administrators. The reports are designed to cover common audit needs and can be used as-is. When auditing is enabled and audit events are being recorded, they will contain up-to-the-minute records of events on your server. You can run the reports or schedule them as needed. The Ad Hoc view used to create each report is included as well. You can open these in the Ad Hoc editor to explore the audit data in real-time. You can also modify these views in the Ad Hoc Editor to generate new reports to suit your auditing requirements. The following views and reports are provided:

Audit Report Generic example of a an audit report showing commonly audited events. Performance Crosstab Report A crosstab that shows average performance of reports that were run. Performance Report Generates a list of reports that were run and sorted by run-time to identify slow reports. Repository Resources Report Shows repository resources and their associated events. Resource Execution Report Generates a list of reports that were run. User Activity Report Generates a list of reports run by a specific user.

8.4

Using the Monitoring Data

JasperReports Server makes the monitoring data available to administrators through a Domain and several prepared views and reports. These are located in the /Public/Monitoring folder of the repository.

Figure 8-3

Monitoring Reports in the Repository

To create an Ad Hoc View based on the audit Domains, select Create > Ad Hoc View, select the Domains tab in the Data Chooser, and expand the folders to select the monitoring Domain. For instructions on using Domains in reports, see the Ad Hoc chapter in JasperReports Server User Guide. For documentation of Domains in general, see the Domains chapter in the same manual. The following sections explain the contents of the Domains and the reports that are provided.

8.4.1

Domain Items

The monitoring Domain exposes the fields of the monitoring tables stored in the servers internal database. As with all Domains, the database tables are joined, and the fields are presented as items that can be used in Ad Hoc views.

148

Server Diagnostics In this release of JasperReports Server, the monitoring fields are limited to those that record report execution events: Domain Item
Day Editing Action

Description
Day of the month the report finished running. The Ad Hoc editing step that the user just performed (null for report execution):
insertDimensionInAxisWithChild A dimension was added. addMeasure A measure was added. setProperty A property was set. moveDimension A dimension was moved.

Event Context

The context that triggered the report execution. Possible values are:
ui The report ran interactively from the user interface. web services The report was run via web services. internal The report ran from an internal process, usually the scheduler.

Event Type

The type of report that was executed. Possible values are:


report execution A report that ran from the repository. ad hoc editing A report that ran from an Ad Hoc view being edited.

Hour id Minute Month Query Execution Time Report Rendering Time Report URI Time Stamp Total Report Execution Time

Hour that the report finished running. ID number of the monitoring event. Minute that the report finished running. Month that report finished running. The time spent executing the SQL query in the database. The time spent rendering the report after receiving the query results (dataset). Repository path of the report that was run. Full time and date that the report was finished running, including milliseconds. The total time spent running the report. Typically this is a little more than the sum of the query execution and report rendering times, due to overhead. Overhead includes tasks such as loading repository resources (report unit, data source, etc) and obtaining a DB connection from the data source. The user who ran the report. The organization containing the user who ran the report. Year that the report finished running.

User Name User Organization Year

8.4.2

Monitoring Views and Reports


The monitoring reports and their views are blank by default, because the audit subsystem that monitoring depends upon is disabled by default and no audit data exists. To view these reports, first enable auditing as described in section 8.2, Configuring Auditing and Monitoring, on page 143, then wait for user activity to generate events.

A number of Ad Hoc views based on the monitoring Domain are provided in the Public/Monitoring/Monitoring Reports folder. The reports are designed to cover common monitoring needs and can be used as-is. When monitoring is enabled and audit events are being recorded, the reports will contain up-to-the-minute records of events on your server. You can run the reports or schedule them as needed.

149

JasperReports Server Administrator Guide The Ad Hoc view used to create each report is included as well. You can open these in the Ad Hoc editor to explore the monitoring data in real-time. You can also modify these views in the Ad Hoc Editor to generate new reports to suit your monitoring requirements. The following views and reports are provided:

Report Monitoring Resources Report Gives a list of all reports that were run and shows their average and high-low runtimes. Report Monitoring Details Report A crosstab that shows report runtimes on one axis and many dimensions such as a time hierarchy, user and organization, and event type on the other axis,.

Figure 8-4

Monitoring Ad Hoc View with Multi-dimensional Analysis

8.5

Importing and Exporting Event Data

Audit and monitoring data can be imported and exported with the utilities described in chapter Chapter 6, Import/Export, on page 99.

To export audit data, use the --include-audit-events option in the export command. To export monitoring data user the --include-monitoring-events option in the export command. To import audit data, import the catalog containing audit data with the --include-audit-events option. To import monitoring data, import the catalog containing audit data with the --include-monitoring-events option.
Data in temp folders is not exported.

8.6

Real-Time Diagnostics

With JasperReports Server 5.0, Jaspersoft introduces full instrumentation of the server so that it can provide real-time diagnostic information such as memory usage, concurrent reports being run, cache statistics, and much more. Whereas auditing and monitoring provide a historical record of events on the server, diagnostics display the current status of the server and its Java Virtual Machine (JVM) environment. 150

Server Diagnostics The diagnostic feature relies on the Java Management Extensions (JMX) industry standard to gather run-time data and expose it to other management interfaces. JasperReports Server implements several elements of the JMX architecture:

New JMX managed beans that are used to gather and hold diagnostic data such as the number of concurrent reports. Its own JMX agent, like a server, that responds to JMX requests and exposes the information from the managed beans. Connections to existing JMX managed beans in other components such as Ehcache to include their diagnostic data. Connections to other JMX agents such as JVM agent to gather system diagnostics If you have an external management console that can connect to a JMX agent, you can use it to connect to the servers JMX agent. You will probably also want to connect to the JVMs JMX agent as well. You can then view the real-time diagnostic data from JasperReports Server integrated with the data from your other servers in your management console. Management consoles often offer further functionality such as thresholds and alarms that you can set on data from any JMX managed bean. Jaspersoft provides a custom data source within the server that collects the same information from the managed beans in the server and in the JVM. You can then create JasperReports that access this data source and present this diagnostic data in a report that suits your needs. Jaspersoft also provides a report and an Ad Hoc Topic to demonstrate this.

There are two ways to use diagnostic data from JasperReports Server:

8.7

Exposing Diagnostics Through Jaspersofts JMX Agent

By default, the diagnostic feature is configured to allow access to the diagnostic data through a remote management console that supports JMX. This allows you to integrate JasperReports Server diagnostics with your overall IT management strategy. Alternatively, the Java Development Kit provides the jConsole tool that uses JMX and can be used to monitor your server remotely. All of these management consoles access the JMX agent provided with JasperReports Server, and access is secured by the same users, passwords, and roles used by the servers web interface.

8.7.1

Connecting to the JMX Agent

To connect your management console to the JasperReports Servers JMX agent, initiate a new connection from your console and specify the following connection string:
service:jmx:rmi://localhost/jndi/rmi://<host>:<port>/<connectionName>

where:

<host> is the computer where JasperReports Server is running <port> is the JMX port, by default 10990 <connectionName> is the name of the JMX agent, by default jasperserver

Therefore, the default connection string is:


service:jmx:rmi://localhost/jndi/rmi://<host>:10990/jasperserver

When prompted to enter a username and password, you must give a user with the following roles: Commercial Editions: ROLE_SUPERUSER, thus by default the superuser user Community Project: ROLE_ADMINISTRATOR, thus by default the jasperadmin user The following sections explain how to modify the default connection values for:

The connection name The JMX port The required roles

8.7.2

Configuring the Port and Connection Name

The connection name is the name registered for the JMX agent with the remote method invocation (RMI) service. If you have more than one JasperReports Server instance in a single app server, you need to change the registered connection name.

151

JasperReports Server Administrator Guide There are times you may want to change the port from default (10990) to another port, for example, if another service is configured to use the default port (e.g. another app server with JRS running). To change the port or connection name, edit the default_master.properties file before you deploy a conflicting server instance. Find the following lines and edit the values to your desired port number and connection name:
diagnostic.jmx.port = 10990 diagnostic.jmx.name = jasperserver

8.7.3

Configuring Roles for JMX Connections

If you wish to allow other users to establish the JMX connection from a remote management console, you must configure JasperReports Server to allow other roles:

For commercial editions, edit the WEB-INF/applicationContext-Diagnostic-pro.xml file and modify the following setting:
<util:list id="diagnosticAllowedRolesPro"> <value>ROLE_SUPERUSER</value> </util:list>

For community projects, edit the WEB-INF/applicationContext-Diagnostic.xml file and modify the following setting:
<util:list id="diagnosticAllowedRolesCe" value-type="java.lang.String"> <value>ROLE_ADMINISTRATOR</value> </util:list>

In both cases, you can change the existing role or add additional lines containing alternate <value>ROLE_name</value>.

8.7.4

Disabling Remote Connections to the JMX Agent

By default, remote connections to JMX Agent are enabled and configured as described in section 8.7.1, Connecting to the JMX Agent, on page 151. To disable remote connections, edit the applicationContext-diagnostic.xml file and make the following changes:

Comment out the entire jMXAuthenticator bean. Comment out the entire jMXregistry bean. Comment out the entire jasperJMXServerConnector bean. Comment out or remove the property depends-on="jMXregistry" in the jasperJMXServer bean

To comment out a section of this XML file, surround it with <!-- and --> tags.

8.7.5

Alternative Connection Through App Server JMX Service

Most app servers also have a JMX agent, and if they are configured properly, they can discover the JasperReports Server JMX agent and expose the diagnostic information. However, this connection has some significant security implications:

When the app server discovers and connects to the JMX agent, it has full access to the diagnostic information. If the app servers JMX agent is configured for remote access, then the remote manager also has access to the JasperReports Server JMX agent--without needing to provide the JasperReports Server username and password. In other words, by trusting the app server to access the diagnostic information, you are also allowing anyone that the app server trusts to connect. The connection between the two JMX agents is reciprocal. If remote access is still enabled on the JasperReports Server JMX agent, a remote manager who connects to it also sees the contents of the app server JMX agent. In other words, the app server JMX agent is also trusting anyone who we trust to connect to our JMX agent (with our username and password).

152

Server Diagnostics To connect automatically to the app servers JMX agent, assuming one is available, edit the default_master.properties file before you deploy the JasperReports Server web app, and add the following line:
diagnostic.jmx.usePlatformServer = true

If the app server is Apache Tomcat for example, a local JMX connection named Catalina appears to anyone accessing the JasperReports Server JMX agent.

8.8

Using the Diagnostic Data In Reports

In addition to remote JMX connections, JasperReports Server makes the diagnostic data available to administrators through a internal reports. The following resources are visible to the system admin (superuser by default) in the repository:

/Public/Monitoring/Diagnostic Data Source A custom data source that returns all of the diagnostic fields. /Public/Monitoring/Diagnostic Report A report that displays nearly every single diagnostic field. /Public/Ad Hoc Components/Topics/Diagnostic Topic A JRXML resource that can be used as a Topic to create an Ad Hoc view using diagnostic fields.

Figure 8-5

Diagnostic Report in the Repository

The following figure shows the beginning of the diagnostic report. This report displays nearly every field that is available through JMX and the diagnostic subsystem. This report serves as a reference for the diagnostic data. The report is also very useful when configuring your server because it shows many server configuration settings as well as system information such as memory usage. You can use this information to fine tune the performance of your JasperReports Server instance.

153

JasperReports Server Administrator Guide

Figure 8-6

Contents of the Diagnostic Report

8.9

Excluding Diagnostic Attributes

By default, the JasperReports Server diagnostic feature exposes all available fields as JMX attributes. If you would like to limit what is exposed, you can exclude any of the attributes through the configuration. To exclude an attribute, edit the WEB-INF/applicationContext-Diagnostic.xml file and add it to the set defined in the
excludedDiagnosticAttributes property. For example, if you want to hide the Environment and Properties attributes in the ExternalInfo section, add those values to the excludedDiagnosticAttributes set in the diagnosticExternalInfoCe bean, as follows: <property name="excludedDiagnosticAttributes"> <set> <value>Environment</value> <value>Properties</value> </set> </property>

154

Troubleshooting

APPENDIX A TROUBLESHOOTING
This section describes functionality that can be restricted by the software license for JasperReports Server. If you dont see some of the options described in this section, your license may prohibit you from using them. To find out what you're licensed to use, or to upgrade your license, contact Jaspersoft.

This appendix contains the following sections:


Number of Users Exceeded Field Names Disappear in Ad Hoc Editor Scheduler Sending Multiple Emails Adding Data Sources

A.1

Number of Users Exceeded

When there are more users defined in the server than your license allows, the login page displays a warning; users can still log in. After a 24-hour grace period, an email is sent to the administrator and users can no longer log in. Most server functionality is disabled. To re-enable server functionality:

Contact Jaspersoft sales to purchase additional user licenses. When you install the new license, the server becomes fully functional for all users. Remove users until the number of user accounts on the server is in accord with your license. When server functionality is disabled, administrators can still log on and select Manage > Users to delete user accounts. For more information see section 2.2, Managing Users, on page 25.

A.2

Field Names Disappear in Ad Hoc Editor

Some fields with international characters in their display names disappear when the field is dragged into the canvas of the Ad Hoc Editor. This is caused by non-Unicode characters used in the field name in the JRXML underlying the selected Topic. To make the international characters appear in Ad Hoc view field labels, use the resource bundle mechanism: 1. 2. 3. Create a resource bundle (*.properties) and associate each of your field label with a unique key. Use unicode escape sequences such as \u0153 for the character to insert international characters in your label values. Use the $R syntax in the Topic to specify the appropriate key for the label of each desired field. Upload the resource bundle as a resource of the Topic.

When you open the Topic in the Ad Hoc Editor, the labels are displayed correctly from the resource bundle. 155

JasperReports Server Administrator Guide This method has the advantage that you can create a resource bundle for each language that the Topic needs to support, and users see the labels for the locale they set in their browser. For more information about localizing JasperReports Server, see Appendix C, Localization, on page 167.

A.3

Scheduler Sending Multiple Emails

In cases where you have a cluster of JasperReports Server instances accessing the same repository, the schedulers in each instance can sometimes conflict and send multiple emails. The behavior depends on the run-time of the reports that are scheduled, because a long report may cause the scheduler on another node to attempt to run the same report before the first node finishes. To change this behavior, set the following parameter in <WAR-file>/WEB-INF/js.quartz.base.properties:
org.quartz.jobStore.clusterCheckinInterval = 900000

In case a job fails on the first node, the check-in interval is meant to ensure that the job runs on a second node after this delay. Because the schedulers do not communicate directly, the second scheduler cannot distinguish between a node that had a failure and a node that is still running a job. The default value corresponds to 15 minutes. This parameter can be adjusted as follows:

If you have scheduled reports that take a long time to run, longer than 15 minutes, you may see multiple emails. Increase this parameter to an interval longer than your longest reports expected run-time. On the other hand, if you have small reports that finish quickly, the default value means that any scheduler or node problem isnt detected by the other scheduler before 15 minutes. If you have time-critical reports scheduled, you can lower this parameter, but the value should still exceed your longest expected report run-time.

Restart all of your server instances after changing this parameter.

A.4

Adding Data Sources

When adding a data source to JasperReports Server, there are several areas that can cause errors.

A.4.1

JDBC Driver in Classpath

JasperReports Server ships with drivers for several databases: DB2, Oracle, PostgreSQL, and SQL Server. It is important to ensure that the driver for the database that you want to set up as a data source is included in the servers classpath. Refer to the JasperReports Server Installation Guide for the location of the drivers and how to set the classpath.

A.4.2

JDBC Driver Name

When creating a data source, you type in the name of the JDBC driver for your database. Because the names for drivers are different for each database, and typing class names is prone to error, make sure you typed the exact class name for your database: Database
MySQL Ingres Oracle DB2 SQL Server

JDBC Driver Class Name


com.mysql.jdbc.Driver com.ingres.jdbc.IngresDriver oracle.jdbc.OracleDriver com.ibm.db2.jcc.DB2Driver com.microsoft.sqlserver.jdbc.SQLServerDriver

156

Troubleshooting

A.4.3

Database Permissions

When creating database users, you must ensure that they have the appropriate privileges to access data, as well as permission to connect from the server that JasperReports Server is running on.

The database user that you specify in your data source definition should have the appropriate select permissions to query the tables within your database for the reports you want to generate. If you accept the defaults during installation of JasperReports Server on Linux from an RPM using apt-get, rpm, or yum, the bundled PostgreSQL only allows the user who owns PostgreSQL to connect. Enter the following commands to connect:
su - postgres psql -U postgres

Many databases, including MySQL, also require that the user permissions name the specific host from which connections are allowed. Otherwise, when testing the JDBC connection, a connection may not be allowed even though the user name and password are correct. For example, this setting for MySQL users is documented at http://dev.mysql.com/doc/refman/ 5.1/en/adding-users.html.

A fairly easy way to test permissions and connectivity is to use a tool such as SquirrelSQL or another DB query tool to connect to the database from the same host as JasperReports Server and to run typical queries against your database.

A.4.4

JDBC Database URL

Ensure that the database URL you entered when defining your JDBC data source is consistent with what is required for your specific database and database driver. The following table gives the default URLs and port numbers: Database
PostgreSQL MySQL Ingres Oracle DB2

Default JDBC Database URL


jdbc:postgresql://localhost:5432/jasperserver jdbc:mysql://localhost:3306/jasperserver?useUnicode=true&characterEncoding= UTF-8 jdbc:ingres://localhost:II7/jasperserver;CURSOR=READONLY;auto=multi jdbc:oracle:thin:@localhost:1521:orcl jdbc:db2://localhost:50000/jsprsrvr:driverType=4;fullyMaterializeLobData=true; fullyMaterializeInputStreams=true;progressiveStreaming=2;progresssiveLocators=2; currentSchema=JSPRSRVR jdbc:sqlserver://localhost:1433;databaseName=jasperserver;SelectMethod=cursor

SQL Server

A.4.5

JNDI Services on Apache Tomcat

If you have trouble with a JNDI connection, you need to look at the JNDI definition for your database on your application server. This section gives common issues with JNDI definitions on Apache Tomcat connecting to MySQL. If you use a different application server or database server, refer to its documentation. A JNDI connection on Tomcat is defined in two different files. Make sure both have the following information:

<tomcat>/webapps/jasperserver[-pro]/META-INF/context.xml
<Resource name="jdbc/<db-name>" auth="Container" type="javax.sql.DataSource" maxActive="100" maxIdle="30" maxWait="10000" username="<db-user>" password="<db-user-password>" driverClassName="org.postgresql.Driver" validationQuery="SELECT 1" testOnBorrow="true" url="jdbc:mysql://<host>:3306/<database>?autoReconnect=true&amp;autoReconnect ForPools=true"/>

157

JasperReports Server Administrator Guide

<tomcat>/webapps/jasperserver-pro/WEB-INF/web.xml
<resource-ref> <description>JNDI Example</description> <res-ref-name>jdbc/<db-name></res-ref-name> <res-type>javax.sql.DataSource</res-type> <res-auth>Container</res-auth> </resource-ref>

Also check the following points:


Ensure the driver for your database connection is in the <tomcat>/lib folder. This is the same database-specific driver class that is given in section A.4.2, JDBC Driver Name, on page 156. If you installed JasperServer from a WAR file, Tomcat may have created a separate copy of context.xml in <tomcat>/ conf/Catalina/Localhost/jasperserver-pro.xml. See the corresponding section in the troubleshooting appendix of the JasperReports Server Installation Guide. See the Apache Tomcat documentation at http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howto.html.

A.4.6

JNDI Services on JBoss

After defining JNDI Services on the JBoss application server, JasperReports Server does not automatically detect the new services. In order to use the new JNDI services as data sources in the server, follow these steps: 1. 2. 3. 4. Define and deploy a JNDI data source in the JBoss administrator console. Modify the file <jboss>/webapps/jasperserver-pro/WEB-INF/web.xml to include a data source reference to this new JNDI service. Modify jboss-web.xml to include a reference to this data source. Because the deployment configuration files such as web.xml were modified, redeploy the JasperReports Server application.

Now you can define JNDI data source in the repository, as described in section 4.1.2, JNDI Data Sources, on page 56.

A.4.7
1.

JNDI Services on WebLogic

Follow these steps to configure JasperReports Server to use JNDI data sources with WebLogic: Append the following definition to the <reference-descriptor> node of WEB-INF/weblogic.xml:
<resource-description> <res-ref-name>TestDatabase</res-ref-name> <jndi-name>jdbc/testDatabase</jndi-name> </resource-description>

2.

Append the following definition to WEB-INF/web.xml:


<resource-ref> <description>TestDatabase database</description> <res-ref-name>TestDatabase</res-ref-name> <res-type>javax.sql.DataSource</res-type> <res-auth>Container</res-auth> </resource-ref>

3. 4.

In the WebLogic Admin Console, add a datasource with TestDatabase as the JNDI name. Restart the jasperserver-pro instance using the WebLogic Admin Console.

158

Integrating With Liferay Portal

APPENDIX B INTEGRATING WITH LIFERAY PORTAL


These instructions assume that both JasperReports Server and Liferay have been installed properly. You can get Liferay from http://www.liferay.com; for instructions about installing it, refer to its documentation. For instructions about installing JasperReports Server, refer to the JasperReports Server Installation Guide. This appendix also assumes:

You are using Liferay deployed in Tomcat. <js-install> is the root of your JasperReports Server installation. <liferay-install> is the root of your Liferay installation. This path cannot contain any spaces. <liferay-install>\<tomcat-dir> is the root of the Tomcat instance running Liferay.
The instructions in this chapter describe how to deploy the portlet WAR that is included in the JasperReports Server distribution. If you are implementing the JasperReports Server portlet from a different distribution, refer to the instructions provided in that distribution. If you are upgrading from a previous version of JasperReports Server in which you deployed the Liferay portal, you must take additional steps; pay careful attention when following the instructions in this chapter.

The appendix contains the following sections:


Changing Liferays Port Numbers Configuring JasperReports Server to Accept Web Services Calls Configuring Liferay to Access JasperReports Server Setting the Portal Organization Testing Liferay Deploying the JasperReports Server Portlet WAR File Configuring a Default Report to Display Input Controls in the Portlet Testing the JasperReports Server Portlet JasperReports Server Portlet Configuration Options Setting up JasperReports Library Hyperlinks for Use in a Portlet

B.1

Changing Liferays Port Numbers

By default, both Liferay and JasperReports Server run on port 8080. You must change Liferays listening port to avoid this conflict. For example, you can change Liferays listening port to 7080. You must also update a number of other Liferay ports.

159

JasperReports Server Administrator Guide


To configure Liferays port numbers:

1.

In the server.xml file (found at <liferay-install>\<tomcat-dir>\conf\), change all the occurrences of port numbers. This table suggests effective replacement ports: Port
Server Port Non-SSL Connector Port AGP 1.3 Connector Port Proxy Connector Port Default Value 8005 8080 8009 8082 Suggested Value 7005 7080 7009 7082

2.

Also change the port numbers in the server-minimal.xml file (found at <liferay-install>\<tomcat-dir>\conf\): Port
Server Port Catalina Connector Port AGP 1.3 Connector Port

Default Value
8005 8080 8009

Suggested Value
7005 7080 7009

3.

Start the Liferay Portal by entering the following at the command prompt:
Linux Windows <liferay-install>/<tomcat-dir>/bin/startup.sh <liferay-install>\<tomcat-dir>\bin\startup.bat

B.2

Configuring JasperReports Server to Accept Web Services Calls

Configure JasperReports Server to accept web service calls from Liferay by updating: <js-install>/webapps/jasperserver-pro/WEB-INF/applicationContext-security.xml.
To configure JasperReports Server to accept web services from trusted hosts:

1. 2. 3.

Start JasperReports Server. Locate the trustedIpAddress property in the applicationContext-security-web.xml file found at <js-install>/webapps/ jasperserver-pro/WEB-INF. Add the IP address of your Liferay Portal host. For example, if Liferay is running on a computer with the IP address 123.45.6.789, the trustedIpAddress property would be:
<property name="trustedIpAddress"> <list> <value>123.45.67.89</value> </list> </property>

You can also use the value localhost or 127.0.0.1 for this property. 4. Restart JasperReports Server.

160

Integrating With Liferay Portal

B.3

Configuring Liferay to Access JasperReports Server

The JasperReports Server portlet uses web services to retrieve information from JasperReports Server. This parameter specifies the JasperReports Server repository web service URL. Its normally of the form: http://<host:port>/jasperserver-pro/services/repository or https://<host:port>/jasperserver-pro/services/repository For example: http://123.45.67.89:7080/jasperserver-pro/services/repository
To configure Liferay to access JasperReports Server:

1.

Locate the jasperserver_repository_ws_url parameter of the portlet.xml file found at <liferay-install>/<tomcatdir>/webapps/<JasperServerPortlet-x.x.x>/WEB-INF.

Set its value to the URL of the JasperReports Server repository web service. For example:
<init-param> <name>jasperserver_repository_ws_url</name> <value>http://123.45.6.789:8080/jasperserver-pro/services/repository</value> </init-param>

2.

Restart Liferay.

B.4

Setting the Portal Organization

You can connect to only one Portal organization but you can set the organization to any name.
To set the Portal organization:

1. 2.

Start JasperReports Server. Locate the following line in JavaBean mtPortletAuthenticationProcessingFilter in the applicationContext-multitenancyweb.xml file found at <js-install>/webapps/jasperserver-pro/WEB-INF:
<property name="portletOrganizationId" value="portal"/>

3. 4.

Set the value of portal to the desired organization. Restart JasperReports Server.

See also the note in section B.9, Testing the JasperReports Server Portlet, on page 163.

B.5
1. 2.

Testing Liferay

To test Liferay:

Enter your Liferay Portal URL in your browsers address bar. For example: http://<liferay host> Login to Liferay; by default the sample data in Liferay includes a default Admin user with these credentials:

User name: [email protected] Password: bruno User name: [email protected] Password: test

3.

If the sample data is used, the default administrative user becomes valid:

If the portal appears, Liferay is properly installed.

161

JasperReports Server Administrator Guide

B.6

Deploying the JasperReports Server Portlet WAR File

If you are upgrading from a previous version of JasperReports Server (then called JasperServer) in which you deployed the portlet WAR file, you must delete the webapps/Jaspersoft folder of the application server hosting Liferay. This deletes libraries used in older versions that conflict with libraries in the latest version. Once this folder is deleted, you can deploy the new portlet WAR.
To deploy the portlet WAR file,

1. 2. 3.

Copy JasperServerPortlet-3.7.0.war to <liferay-install>\<tomcat-dir>\deploy Ensure that Liferay is running. Login on the Liferay Portal as a user with administrative privileges. For example, [email protected]. The default password is bruno. If you just started Liferay, it attempts to deploy the WAR file (this step may take several moments, depending on your environment).

4.

When Liferay finishes the deployment, click Add Application > Jaspersoft > JasperServer Portlet appears. If the JasperReports Server portlet appears, it is deployed.

Note that you can run multiple instances of the portlet at once.

B.7

Configuring a Default Report to Display

By default, the portlet displays all the reports that the current user is allowed to view. You can configure the portlet to display a specific report, instead. In the portlet.xml file, add the following entries to specify a default report:

full_resource_path: This parameter specifies the full report Path. resource_type: The only supported value is report number_of_parameters: This specifies the number of parameters the report requires, including optional and required

parameters.
js_resource_parameter_<parameter>: For each parameter of the report, append prefix js_resource_parameter_ to the name. In this example, the report /reports/samples/EmployeeAccounts takes a parameter named EmployeeID; it is defined as js_resource_parameter_EmployeeID. modifiable: This value has to be 1 [one] so end users can choose different reports at run time. 1 is the only supported

value. For details of this parameter, please refer to the JSR-168 specification. For example, the portlet configuration section of the portlet.xml file might be similar to the following:
<portlet-preferences> <preference> <name>full_resource_path</name> <value>/reports/samples/EmployeeAccounts</value> <modifiable>1</modifiable> </preference> <preference> <name>resource_type</name> <value>report</value> <modifiable>1</modifiable> </preference>

162

Integrating With Liferay Portal


<preference> <name>number_of_parameters</name> <value>1</value> <modifiable>1</modifiable> </preference> <preference> <name>js_resource_parameter_EmployeeID</name> <value>beth_id</value> <modifiable>1</modifiable> </preference> <portlet-preferences>

If you remove this section, the JasperReports Server Portlet displays a list of reports that the current user can access.

B.8

Input Controls in the Portlet

The portlet supports basic input controls so that you can interact with any report that uses them. Whether required or optional, you can interact with the input controls for a report by opening the report options in the portlet. However, due to a limitation, the JasperReports Server Portlet does not support cascading input controls. Input controls are said to be cascading when the value of the first input updates the selection values for other inputs, for example selecting a country and then a city input. Reports with cascading input controls may be displayed if there are default values provided for the corresponding parameters, but when opening the report options, the user cannot interact with any cascading controls.

B.9
1. 2. 3.

Testing the JasperReports Server Portlet

To test the portlet:

Login to Liferay as described in B.5, Testing Liferay, on page 161. Verify that the reports you configured in B.7, Configuring a Default Report to Display, on page 162 appear in the JasperReports Server portlet. If the portlet doesnt appear, add it as described in B.6, Deploying the JasperReports Server Portlet WAR File, on page 162.
When Liferay connects to JasperReports Server, JasperReports Server looks for the Portal organization; it creates this organization if it doesnt exist. The server also looks for the user ID; if the ID is found, the server allows access; if it isnt found, the user is created and assigned the ROLE_PORTLET and ROLE_USER roles. If your JasperReports Server instance hosts multiple organizations, the user is mapped to the Portal organization.

B.10

JasperReports Server Portlet Configuration Options

You can configure several parameters that control the JasperReports Server portlet. They are located in the <liferay-install>/ <tomcat-dir>/webapps/<JasperServerPortlet-x.x.x>/WEB-INF/portlet.xml file. You must restart Liferay for these changes to take effect.
The values described in this section are case-sensitive.

163

JasperReports Server Administrator Guide The following table lists the configurable parameters of the portlet: Portlet Parameters Parameter
portal_server

Code & Comment


<init-param> <name>portal_server</name> <value>liferay</value> </init-param> The only supported value for this parameter is liferay.

show_logo

<init-param> <name>show_logo</name> <value>true</value> </init-param> This parameter indicates whether the company logo (at the top righthand corner of the portlet) is displayed. Any value other than true hides the logo.

show_return_to_report_list_icon

<init-param> <name>show_return_to_report_list_icon</name> <value>true</value> </init-param> The parameter indicates whether the Return to Report List icon is displayed. Any value other than true hides the icon.

show_return_to_parameter_icon

<init-param> <name>show_return_to_parameter_icon</name> <value>true</value> </init-param> The parameter indicates whether the Report Options icon should be shown. Any value other than true hides the icon.

company_logo

<init-param> <name>company_logo</name> <value>jaspersoft-logo.png</value> </init-param> This parameter specifies the image to use when show_logo is set to true. The picture must be located under <liferay-install>/<tomcat-dir>/ webapps/<JasperServerPortlet-x.x.x>/WEB-INF/images/.

company_logo_hyper_link

<init-param> <name>company_logo_hyper_link</name> <value>http://www.jaspersoft.com</value> </init-param> This parameter specifies the hyperlink URL to request when a user clicks the company logo.

164

Integrating With Liferay Portal Portlet Parameters, continued Parameter


report_directory

Code & Comment


<init-param> <name>report_directory</name> <value>/</value> </init-param> This parameter specifies a folder in the repository that should be used to populate the Report List page in the portlet.

number_of_reports_per_page

<init-param> <name>number_of_reports_per_page</name> <value>5</value> </init-param> This parameter specifies the pagination limit for the Report List page. It specifies how many reports to display per page. When there are more reports than the specified number, end users must click a link to go to next page.

This table shows examples of the updated files and values that must be edited to enable Liferay integration with JasperReports Server: Examples of Liferay-related Files and Values File
portlet.xml

Code & Comment


<init-param> <name>jasperserver_repository_ws_url</name> <value>http://123.45.6.789:8080/jasperserver-pro/ services/repository</value> <!-- You can also use the value localhost or 127.0.0.1 --> </init-param> Default Location: <liferay-install>/<tomcat-dir>/webapps/ <JasperServerPortlet-x.x.x>/WEB-INF/.

applicationContext-security

<property name="trustedIpAddress"> <list> <value>123.45.6.789</value> <!-- You can also use the value localhost or 127.0.0.1 --> </list> </property> By default, this file is found at <js-install>/webapps/jasperserver-pro/ WEB-INF/.

Browser URL

Users point their browsers to http://Liferay_host:7080/c/portal.

B.11

Setting up JasperReports Library Hyperlinks for Use in a Portlet

Because the portal environment is different than that of JasperReports Server when runs stand-alone, the behavior of links in reports is also different. Although any valid JasperReports Library link is rendered in the portal environment, the hyperlinks

165

JasperReports Server Administrator Guide behave differently than if the report is run directly in JasperReports Server. For example, some hyperlinks might become static text when running in a portal server.
This section assumes that you are using Jaspersoft iReport Designer to set up the hyperlinks.

The JasperReports Server portlet supports these types of links: Links Supported by JasperReports Server Portlet Hyperlink
Points to an external URL when the Hyperlink Type is CUSTOM or Reference

Reference Tab
Hyperlink Reference Expression value must start with http:// or https://. When users click the link in a portlet, the current browser window displays the new web page. The user leaves the portal environment. If Hyperlink is invalid, static text is rendered without links.

Link Parameters Tab


Parameters and values that the target web site receives.

ToolTip Tab
Tooltip for the hyperlink.

Points to a particular page of the same report when the Hyperlink Type is LocalPage.

Hyperlink Reference Expression value specifies the target page number of the current report.

Parameters and values that the target web site receives. For multiple-valued parameters, use the same parameter name for each parameter value. Hyperlink Page Expression value specifies the target page number of the target report.

Tooltip for the hyperlink.

Points to a particular page of a different report when the Hyperlink Type is RemotePage. Notes:

Hyperlink Reference Expression is used in specification of the target page URI.

Tooltip for the hyperlink.

If type None is chosen, no hyperlink is rendered. For both Hyperlink Target values Self and Blank, the target report is displayed in the same portlet window. For Hyperlink Type RemoteAnchor and LocalAnchor, no links are rendered.

166

Localization

APPENDIX C LOCALIZATION
By default, JasperReports Server is presented in the English language (US version), but it supports other languages, as well, with translations that include data formats and resource bundles. The supported languages are Chinese (Simplified), French, German, Italian, Japanese, and Spanish. The translations are included in your JasperReports Server instance by default; to view the application in a specific locale, select it before logging in. If you need to support a language other than the supported ones, you can localize JasperReports Server, including translating it into a different language by providing labels and messages in the preferred language. For other locales, you may also need to change the default locale and time zone. This chapter describes the procedures and a few examples. For information about localizing Domains, Topics, and reports, refer to the JasperReports Server User Guide. This chapter contains the following sections:

Configuring JasperReports Server for the Default Multi-byte Fonts UTF-8 Configuration Creating a Locale Configuring JasperReports Server to Offer a Locale Character Encoding and Fonts

C.1

Configuring JasperReports Server for the Default Multi-byte Fonts

Although translation packs for Chinese and Japanese ship with JasperReports Server, the fonts that it uses by default do not support those languages. Therefore, if your organization requires those fonts, you need to configure JasperReports Server for them.

C.2

UTF-8 Configuration

JasperReports Server uses UTF-8 (8-bit Unicode Transformation Format) character encoding. If your database server or application server uses a different character encoding form, you may have to configure them to support UTF-8. This section provides information for configuring the character encoding for several application servers and database servers. If you use a different application server or database, and its default character encoding isnt UTF-8, you may need to make similar updates to support certain locales. For more information, refer to the documentation for your application server or database.

167

JasperReports Server Administrator Guide

C.2.1

Tomcat

By default, Tomcat uses ISO-8859-1 (ISO Latin 1) character encoding for URIs, which is sufficient for Western European locales, but does not support many locales in other parts of the world. If you plan to support locales that Latin 1 does not support, you must change Tomcats URI encoding format.
If you chose the instance of Tomcat that is bundled with the installer, you do not need to make this change. The bundled Tomcat is pre-configured to support UTF-8. If you installed the WAR file distribution with your own instance of Tomcat and want to support UTF-8, perform the following procedure. To configure Tomcat to support UTF-8:

1.

Open the conf/server.xml file and locate the following code:


<!-- Define a non-SSL HTTP/1.1 Connector on port 8080 --> <Connector> port="8080" maxHttpHeaderSize="8192" maxThreads="150" minSpareThreads="25" maxSpareThreads="75" enableLookups="false" redirectPort="8443" acceptCount="100" connectionTimeout="20000" disableUploadTimeout="true" </Connector>

2.

At the end of this section, insert the following line before the closing tag:
URIEncoding="UTF-8"

3.

For example, after your changes, the section might read:


<!-- Define a non-SSL HTTP/1.1 Connector on port 8080 --> <Connector> port="8080" maxHttpHeaderSize="8192" maxThreads="150" minSpareThreads="25" maxSpareThreads="75" enableLookups="false" redirectPort="8443" acceptCount="100" connectionTimeout="20000" disableUploadTimeout="true" URIEncoding="UTF-8" </Connector>

4. 5.

Save the file. Restart Tomcat.

C.2.2

JBoss

Since JBoss uses Tomcat as its web connector, a configuration change like the one you made for Tomcat (C.2.1, Tomcat, on page 168) also has to be made for JBoss. In this case, the server.xml file is located in the Tomcat deployment directory, typically server/default/deploy/jbossweb-tomcat55.sar. Make the same code changes, then restart JBoss.

C.2.3

PostgreSQL

JasperReports Server requires PostgresSQL to use UTF-8 character encoding for the database that stores its repository as well as for data sources. A simple way to meet the requirement is to create the database with a UTF-8 character set. For example, enter the following command:
create database jasperserver encoding=utf8;

168

Localization

C.2.4

MySQL

By default, MySQL uses ISO-8859-1 (ISO Latin 1) character encoding. However, JasperReports Server requires MySQL to use UTF-8 character encoding for the database that stores its repository as well as for data sources. The simplest way to meet the requirement is to create the database with a UTF-8 character set. For example, enter the following command:
create database jasperserver character set utf8;

To support UTF-8, the MySQL JDBC driver also requires that the useUnicode and characterEncoding parameters be set as in this startup URL: url="jdbc:mysql://localhost:3306/jasperserver?useUnicode=true&characterEncoding=UTF-8" If the MySQL database is a JNDI data source managed by Tomcat, such as the JasperReports Server repository database, the parameters can be added to the JDBC URL in WEB-INF/context.xml. The following is a sample resource definition from that file:
<Resource name="jdbc/jasperserver" auth="Container" type="javax.sql.DataSource" maxActive="100" maxIdle="30" maxWait="10000" username="root" password="password" driverClassName="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost/jasperserver?useUnicode=true&amp;characterEncoding=UTF8" />

JBoss ignores the context.xml file, instead requiring an XML file to define JNDI data sources in the deployment directory, which is typically server/default/deploy. The following is an example of a resource definition in one of those XML files:
<local-tx-datasource> <jndi-name jdbc/jasperserver /> <connection-url> jdbc:mysql://localhost/jasperserver?useUnicode=true&amp;characterEncoding=UTF-8 </connection-url> <driver-class com.mysql.jdbc.Driver /> <user-name jasperadmin /> <password jasperadmin /> <min-pool-size 5 /> <max-pool-size 20 /> <idle-timeout-minutes 0 /> <metadata> <type-mapping mySQL /> </metadata> </local-tx-datasource>

If the database is a JDBC data source configured in the repository, change the JDBC URL by editing the data source in the JasperReports Server repository. The following is an example of the JDBC URL (note that the ampersand isn't escaped):
jdbc:mysql://localhost:3306/foodmart_ja?useUnicode=true&characterEncoding=UTF-8

C.2.5

Oracle

Oracle databases have both a default character set and a national character set that supports Unicode characters. Text types beginning with N (NCHAR, NVARCHAR2, and NCLOB) use the national character set. As of JasperServer 1.2, all the text data used by the JasperReports Server repository (when stored in Oracle) is stored in NVARCHAR2 columns, so that JasperReports Server metadata can use the full Unicode character set. For more information about Unicode text support, refer to the Oracle white paper found at: http://www.oracle.com/technology/tech/globalization/pdf/ TWP_NCHAR_MIGRATION_10gR2.pdf

169

JasperReports Server Administrator Guide To work properly with Unicode data, the Oracle JDBC driver requires you to set a Java system property by passing the following argument to the JVM:
-Doracle.jdbc.defaultNChar=true

In Tomcat, add the variable to JAVA_OPTS in bin/setclasspath.sh (Linux) or bin/setclasspath.bat (Windows): 1. Locate the following line in the script:
Linux Windows # Set the default -Djava.endorsed.dirs argument rem Set the default -Djava.endorsed.dirs argument

2.

Add the following line before it:


Linux Windows JAVA_OPTS="$JAVA_OPTS "-Doracle.jdbc.defaultNChar=true set JAVA_OPTS=%JAVA_OPTS% -Doracle.jdbc.defaultNChar=true

Since JBoss also uses JAVA_OPTS to pass options to the JVM, you can add the same JAVA_OPTS line to bin/run.sh (Linux) and bin/run.bat (Windows). Add it before this line:
Linux Windows # Setup the java endorsed dirs rem Setup the java endorsed dirs

C.3

Creating a Locale

Translation is only one aspect of localization. Creating a locale includes these tasks: Translating labels and messages. Changing date formats. Changing format masks.

The tasks in this section require you to edit these files: File
*.properties files jasperserver_config.properties adhoc_masks

Location
WEB-INF\bundles WEB-INF\bundles WEB-INF\bundles

Purpose of Edits
Translating labels and messages Changing date formats Changing format masks

C.3.1

About Properties Files

JasperReports Server and Jaspersoft OLAP resource bundle files are found in the WEB-INF/bundles directory. JasperReports Server includes a default locale (for example, jasperserver_messages.properties), which is written in the U.S. English. A resource bundle consists of the *.properties files that contain all the labels and messages used in JasperReports Server and Jaspersoft OLAP, customized for a particular locale.

170

Localization Files in Default Resource Bundles Component Using the File


JasperReports Server

File
adhoc_messages.properties

Description
Labels and messages specific to JasperReports Server Professional and Enterprise; includes text for the Ad Hoc Editor. Core labels and messages used in JasperReports Server. Labels and messages specific to JasperReports Server Professional and Enterprise; includes text for the Home page and menu bar. Labels and messages used by JasperReports Server when validating licenses. Configuration properties for dates and date times. Labels and messages used by the calendar control. Labels and messages used in Jaspersoft OLAP. Labels and messages specific to Jaspersoft OLAP Professional and Enterprise; includes text for the Professional and Enterprise user interface. Labels and messages used in Jaspersoft OLAP. MDX validation error messages specific to the internal analysis engine.

jasperserver_messages.properties pro_nav_messages.properties

LicenseMessages.properties jasperserver_config.properties calendar.properties Jaspersoft OLAP ja_mondrian.properties ja-pro_messages.properties

jpivot_messages.properties Mondrian_exception_messages. properties

If you use the JasperReports Server portlet to display JasperReports Server content in a portal (such as Liferay), the deployed portlet includes properties files, as well: File
jaspersoft_portlet_message. properties

Location
WEB-INF\bundles under the location where the portlet is deployed. For example: C:\liferay\webapps\<portlet_context_name>\ WEB-INF\bundles (where <portlet_context_name> is the name specified when the JasperReports Server portlet was deployed).

Description
Labels and messages that appear in the portlet, including the help text. Note that this does not include text in specific reports; to localize the reports content, you must upload its resource bundle to the repository.

Jaspersoft iReport Designer (iReport) and the iReport Plug-in for JasperReports Server (iReport plug-in) have their own resource bundles, including: Component
iReport iReport plug-in

File
ireport.properties irplugin.properties

Description
Labels and messages used in Jaspersoft iReport Designer. Labels and messages used in iReport Plug-in for JasperReports Server.

C.3.2

Creating a Resource Bundle

Create a resource bundle by making a copy of each *.properties file, using the following syntax for the copys file name: <default_file_name>_<locale>.properties, 171

JasperReports Server Administrator Guide where


<default_file_name> is the name of the default version of the properties file, and <locale> is a Java-compliant locale identifier.

For example, consider the core JasperReports Server resource bundle. For various locales, it might be named as follows: File Type
Default resource bundle English French French in Switzerland

File Name
jasperserver_messages.properties jasperserver_messages_en.properties jasperserver_messages_fr.properties jasperserver_messages_fr_CH.properties

For a list of Java-compliant locales, please refer to the Java web site.
The resource bundles described in this document consist of locale-specific Java properties files. Java properties files use the ISO-8859-1 (Latin-1) encoding that is the same as ASCII for all English non-accented characters. For international characters that are not in ISO-8859-1, use Unicode escape sequences (for example \u00e9 is ). To create a new JasperReports Server resource bundle:

1. 2.

Copy each of the properties files (keeping them in the same directory as the originals) and rename them according to your locale. Translate each *.properties files labels and messages into the new language. Some of the strings in the properties files may not seem like English. These cases are typically date formats and format masks that may need to be edited for the new locale. For more information, refer to C.3.3, Changing Format Masks and Date Formats, on page 172.

3. 4.

Save the files. If the new locale requires specific character encoding or fonts, ensure that JasperReports Server and the third party software it relies on are configured to support them. For more information, refer to C.5, Character Encoding and Fonts, on page 176.
This locale is not available in JasperReports Server until you follow the steps described in C.4.1, Specifying Additional Locales, on page 174.

C.3.3

Changing Format Masks and Date Formats

Each locale may have its own format masks and rules for displaying dates and datetime values. This section describes the steps you must take to update these options for your new locale.
The data format masks described in this section are used in the Domains and in the Ad Hoc Editor; they appear in Ad Hoc views as well as JRXML reports based on Domains; they are not applicable to Jaspersoft OLAP.

C.3.3.1

Changing Date and Datetime Formats

System date and datetime formatting is controlled by four patterns that are specified in the jasperserver_config_<locale>.properties file associated with a particular locale. For example in the English resource bundle, the four entries are:
date.format=dd-MM-yyyy datetime.format=dd-MM-yyyy HH:mm calendar.date.format=%d-%m-%Y calendar.datetime.format=%d-%m-%Y %H:%M

172

Localization The first two keys are used to parse and format dates and datetime values using an internal java.util.DateFormat object across the whole application. These patterns should be non-localized date patterns, in accordance with the Java Development Kit (JDK) syntax. The other two keys are used by the calendar control, which formats the user-selected date and datetime values in accordance with its own pattern syntax. To change the system date and datetime formatting for a new locale, edit the strings specified by these keys. C.3.3.2 Changing Data Format Masks

The Ad Hoc Editor allows you to create custom reports based on a Topic or Domain. Such reports support localizable data format masks that determine how values appear. To make the data format masks vary by locale, you must create an adhoc_masks file for the new locale. To do so, copy the file adhoc_masks.properties to a new name that specifies the new locale and change the masks defined in the new file. For example, the French file would be named adhoc_masks_fr.properties. Customize the available data format masks for dates, integers, and decimals by editing the existing masking entries or adding new ones. The default entries are given in the following table: Data Format Mask Properties
ADH_100_MASK_date_0 ADH_100_MASK_date_1 ADH_100_MASK_date_2 ADH_100_MASK_date_3 ADH_100_MASK_int_0 ADH_100_MASK_int_1 ADH_100_MASK_int_2 ADH_100_MASK_int_3 ADH_100_MASK_dec_0 ADH_100_MASK_dec_1 ADH_100_MASK_dec_2 ADH_100_MASK_dec_3 = = = = = = = = = = = = short,hide long,hide short,medium medium,medium #,##0 0 $#,##0;($#,##0) #,##0;(#,##0) #,##0.00 0 $#,##0.00;($#,##0.00) $#,##0;($#,##0)

Appearance in en_US Locale


3/31/09 Mar 31, 2009 March 31, 2009 Mar 31, 2009 23:59:59 -1,234 -1234 ($1,234) (1234) -1,234.56 -1234 ($1,234.56) ($1,234)

The data format masks for each type are numbered consecutively from zero; create new masks by adding new entries. The keys of the new entries must follow the convention established in the default entries. For example, a new decimal data format mask might have this ID:
ADH_100_MASK_dec_4

Date format masks are implemented using java.text.SimpleDateFormat and JasperReports extensions that provide access to predefined localized data format masks. New datetime masks must be specified in one of the following formats:

A style for the date part of the value and a style for the time part (separated by comma) or a single style for both parts. A style is one of Short, Medium, Long, Full, Default (which correspond to java.text.DateFormat styles) and Hide. A pattern that can be supplied to java.text.SimpleDateFormat. In this case, internationalization support is limited.

Both integer and decimal data format masks are implemented with java.text.DecimalFormat, which localizes characters in the format specification. For example, consider the case of the digit grouping symbol (thousands separator): in French, it is a space; in U.S. English, it is a comma. DecimalFormat handles both cases: if the number pattern #,##0 is used, the number 6000 appears as 6 000 in the French locale and as 6,000 in the U.S. English locale. For more information about Javas handling of decimal and date format masks, refer to Suns website:

http://download.oracle.com/javase/6/docs/api/java/text/DecimalFormat.html http://download.oracle.com/javase/6/docs/api/java/text/DateFormat.html

173

JasperReports Server Administrator Guide


By default, monetary values in Ad Hoc views are masked as USD (United States Dollars). Depending on your data, you may need to support a different currency, support more than one currency, or support currency conversion. These are three very different cases:
Supporting a different currency than USD involves changing the monetary masks to use the correct symbol for your

currency (for example, replace the $ symbol in the ADH_100_MASK_dec_2 and ADH_100_MASK_dec_3 masks). However, changing this symbol does not actually convert currencies in your reports.
Supporting other currencies in addition to USD involves adding new masks. However, adding data formats does not

actually convert currencies in your reports.


Supporting currency conversion is more complicated; you must consider such issues as fluctuations in conversion

rates. Oftentimes, a third-party service can be used to perform currency conversion

C.4

Configuring JasperReports Server to Offer a Locale

After creating a locale, you must configure JasperReports Server to offer it to your users, along with any new time zones. The tasks in this section require you to edit these files: File Name
applicationContext-security.xml jasperserver-servlet.xml

Location
WEB-INF WEB-INF

Purpose of Edits
Specifying additional locales Specifying additional time zones

C.4.1

Specifying Additional Locales

By default, JasperReports Server appears in the locale selected in the end users browser. The Login page allows users to specify the locale they want to use. The list of locales from which they choose is defined in applicationContext-security.xml. Edit this file to add a new locale.
To add a new locale:

1.

Edit the applicationContext-security.xml file and locate the bean named userLocalesList. For example:
<bean id="userLocalesList" class="com.jaspersoft.jasperserver.war.common.LocalesListImpl"> <property name="locales"> <list> <value type="java.util.Locale">en</value> <value type="java.util.Locale">fr</value> <value type="java.util.Locale">it</value> <value type="java.util.Locale">de</value> <value type="java.util.Locale">ro</value> <value type="java.util.Locale">ja</value> <value type="java.util.Locale">zh_TW</value> </list> </property> </bean>

2.

Add the new locale to the end of the list. For example, add the following line for Dutch (Javas nl_NL locale):
<value type="java.util.Locale">nl_NL/value>

3.

Save the file.

174

Localization 4. Restart JasperReports Server, and log into the web application to test your translation. Reviewing the translated strings in context can help you improve your word choices.

For a list of Java-compliant locales, please refer to the Java web site.

C.4.2

Specifying Additional Time Zones

By default, JasperReports Server assumes the users time zone is the same as the time zone of the JasperReports Server host. However, the Login page allows users to choose a different time zone. The list from which they choose is defined in applicationContext.xml file.
To add a time zone:

1.

Open the applicationContext.xml file and locate the userTimeZonesList bean. For example:
<bean id="userTimeZonesList" class="com.jaspersoft.jasperserver.war.common.JdkTimeZonesList"> <property name="timeZonesIds"> <list> <value>America/Los_Angeles</value> <value>America/Denver</value> <value>America/Chicago</value> <value>America/New_York</value> <value>Europe/London</value> <value>Europe/Berlin</value> <value>Europe/Bucharest</value> </list> </property> </bean>

2.

Add the new time zone to the bottom of the list. Specify each time zone as the standard Java time zone values so that JasperReports Server adjusts for daylight savings time when appropriate. For example, add the following line for Tokyo:
<value>Asia/Tokyo</value>

3. 4.

Save the file. Restart JasperReports Server.

For more information about Java-complaint time zones, please refer to the Java web site.

C.4.3

Setting a Default Time Zone

If you want JasperReports Server to use a time zone that is different from the host computer, you can set a specific time zone in Java. It becomes the default time zone for all users, but they may still select a different time zone when they log in. To set a default time zone, set the user.timezone property in the JVM as shown in the tables below. Locate the file containing JVM settings for your platform and application server. The value for the property must be a Java-compliant time zone, for example, Europe/Bucharest. You must restart your application server for this setting to take effect. The time zone is set for all applications in your application server, including JasperReports Server.

175

JasperReports Server Administrator Guide JVM Settings for Default Time Zone Operating System
Windows

App Server
Tomcat JBoss

File
<apache-tomcat>\bin\setenv.bat <jboss>\bin\run.bat <apache-tomcat>/bin/setenv.sh <jboss>/bin/run.sh <glassfish>/domains/domain1/ config/domain.xml

Setting
Add this line of code: set JAVA_OPTS=%JAVA_OPTS% -Duser.timezone=<timezone> Add this line of code: export JAVA_OPTS="$JAVA_OPTS -Duser.timezone=<timezone>" Add this line of code to <jvm-options> section: -Duser.timezone=<timezone>

Linux

Tomcat JBoss

Both

GlassFish

C.5

Character Encoding and Fonts

Depending on the third-party software you use and the locales you support, you may also have to configure JasperReports Server and its host. The steps described in this section are only necessary under certain circumstances, such as if you plan to use a character encoding form that UTF-8 cannot handle or if you need to change the font options for Jaspersoft OLAP charts. The tasks in this section require you to edit these files: File Name
applicationContext.xml jpivot_internal_messages.properties Ja_pro_internal_messages.properties userConfig.xml

Location
WEB-INF WEB-INF/internal WEB-INF/internal WEB-INF/jpivot/print

Purpose of Edits
Changing character encoding Specifying chart fonts for Jaspersoft OLAP Community Specifying chart fonts for Jaspersoft OLAP Professional and Enterprise Embedding fonts in PDF

C.5.1

Changing Character Encoding

To use a character encoding form other than UTF-8, you must configure JasperReports Server, your application server, and your database server. C.5.1.1 Configuring JasperReports Server

To configure JasperReports Server for a different encoding form, you must edit the applicationContext.xml file.
To specify a different encoding form:

1.

Open the applicationContext.xml file and locate the following bean. It is configured for UTF-8:
<bean id="encodingProvider" class="com.jaspersoft.jasperserver.api.common.util.StaticCharacterEncodingProvider"> constructor-arg value="UTF-8"/> </bean>

176

Localization 2. Change UTF-8 to the encoding type your database server and application server use. For example:
<bean id="encodingProvider" class="com.jaspersoft.jasperserver.api.common.util.StaticCharacterEncodingProvider"> constructor-arg value="UTF-16"/> </bean>

3. 4.

Save the file. Restart JasperReports Server. Configuring the Application Server and Database Server

C.5.1.2

If you want to use a character encoding other than UTF-8, you may need to configure the third party software that JasperReports Server relies on. For more information, refer to the documentation associated with your application server and database server. For Tomcat, you can specify a different character encoding by following steps similar to those described in C.2.1, Tomcat, on page 168 and C.2, UTF-8 Configuration, on page 167.
This step is necessary only if you plan to support locales that requires a different character encoding, such as UTF-16. In addition to this change, your application server and database must be configured to use the character encoding you require. For more information, refer to the documentation associated with your third party software.

C.5.1.3

Configuration for Localized Analysis Schemas

If you plan to use localized OLAP views, you must take additional steps to configure JasperReports Server.
To configure JasperReports Server for localized OLAP views:

1.

Every Unicode database that JasperReports Server interacts with (whether it is the repository database or a database accessed through a data source defined in JasperReports Server) must be created to support UTF-8. For example, to create the Foodmart database in PostgreSQL, you might give a command similar to the following:
create database foodmart_ja encoding=utf8;

2.

The URL of any OLAP data source that JasperReports Server accesses must be properly configured in the /ji-pro/METAINF/context.xml file. For example, the URL definition for the Foodmart sample database might be similar to the following:
<Resource name="jdbc/MondrianFoodMart_ja" auth="Container" type="javax.sql.DataSource" maxActive="100" maxIdle="30" maxWait="10000" username="postgres" password="postgres" driverClassName="org.postgresql.Driver" url="jdbc:postgresql://localhost:5432/foodmart_ja" />

3.

Encoding options must be added to the JDBC connection string for any data source that points to an OLAP database. For example, when creating a data source in JasperReports Server that points to an OLAP database, use the following connection string:
jdbc:postgresql://localhost:5432/foodmart_ja

C.5.2

Working with Fonts

While the fonts that JasperReports Server uses are generally dictated by the JRXML files that define your reports, some font configuration is required for special circumstances. For example, you can configure Jaspersoft OLAP to offer different options in the Chart Default Font field in the Chart Options dialog. But note that, in order to use a font, the font must be available to the hosts operating system rather than to the application. This section describes steps you may need to take, depending on the functionality you use and the locales you support. 177

JasperReports Server Administrator Guide C.5.2.1 Enabling East Asian Fonts

The default JRE configuration does not support East Asian fonts. If your locale requires such a font, you need to configure your users computers for the fonts and update the computers JRE.
To configure a Microsoft Windows computer (XP and later) for East Asian fonts: Details of this procedure vary, depending on your version of Windows.

1. 2. 3. 4. 5. 6. 7. 8.

In the Control Panel, click Region and Language. In the Region and Language dialog, select the Keyboards and Languages tab. On the tab, install the language(s) that you need. If necessary, install the related keyboard modifications. Close the control panel. Locate the fontconfig.properties.src file in the C:\Program Files\<JRE_directory>\lib folder. In the file, locate the following line:
sequence.allfonts=alphabetic/default,dingbats,symbol

Change the line to include the East Asian fonts that you need, such as the following:
sequence.allfonts=alphabetic/default,dingbats,symbol,korean,japanese,chinesems936,chinese-ms950

9.

At the end of the file, check to be sure that the fonts you selected are listed, as in the following:
filename.Gulim=gulim.TTC

If the fonts are not listed, add them. 10. Save and close the file. 11. Rename the file to the following: fontconfig.properties C.5.2.2 Configuring Options for Chart Default Fonts

If you implement Jaspersoft OLAP and support a locale with special font requirements, you can configure Jaspersoft OLAP to offer different options in the Chart Default Font field in the Chart Options dialog of the OLAP view. This may be necessary if you implement locales that Latin 1 doesnt support. An OLAP views Chart Options dialog includes the Chart Default Font field, which allows users to select the font to use in charts. The default options are SansSerif, Serif, and MonoSpaced. JasperReports Server reads these values from a properties file and attempts to map them to fonts available in the server hosts operating system. You can configure the server to offer different fonts if these fonts dont support the locales you implement.
To change the Chart Default Font fields options:

1. 2.

Save the jpivot_internal_messages.properties file with a new name that reflects the new locale. For example, for Japanese, the new file would be called jpivot_internal_messages_ja.properties. Open the new file and locate the following keys:
JAJ_000_jsp.jpivot.chartpropertiesform.sansSerif=SansSerif JAJ_000_jsp.jpivot.chartpropertiesform.serif=Serif JAJ_000_jsp.jpivot.chartpropertiesform.monospaced=Monospaced

If you are using Jaspersoft OLAP Community Edition, the name of the file and the keys that you edit are different. For the Community Edition, open the jpivot_internal_message.properties file and edit these keys: jsp.wcf.chart.sansserif=SansSerif jsp.wcf.chart.serif=Serif jsp.wcf.chart.monospaced=Monospaced

178

Localization 3. Change one or more of the strings to the name of a font available in the hosts operating system. For example, if you wanted to change the SansSerif font to the SimHei font, edit the value specified by jsp.wcf.chart.sansserif. For example:
jsp.wcf.chart.sansserif=SimHei

4. 5.

Save the file. Restart JasperReports Server. Embedding Fonts in PDF Output
By default, JasperReports Server can create PDF (Portable Document Format) files with many different fonts. However, if you experience font problems in the PDF output of your reports, you may need to take the steps described in this section to make the fonts available to JasperReports Servers XSL Formatting Object (XSL-FO) processor. You must have distribution rights to a font in order to embed it in a PDF file.

C.5.2.3

When users save reports in PDF format, JasperReports Server generates the PDF output using Apache FOP (Formatting Objects Processor). In order for FOP to render fonts properly, you must install the font itself (for example, a TTF file) on the server host, create a font metrics file (using Apaches org.apache.fop.fonts.apps.TTFReader utility), and update the userConfig.xml file to associate the font with its metrics. For more information, refer to the documentation associated with FOP, which is available at: http://xmlgraphics.apache.org/fop/ You can embed any Unicode font using this procedure, though larger font files may have significantly larger memory footprints. In order to keep memory requirements small, Jaspersoft recommends that you use the smallest font file you can, such as SimHei to support Chinese, Japanese, and Korean.

179

JasperReports Server Administrator Guide

180

Glossary

GLOSSARY
Ad Hoc Editor The interactive data explorer in JasperReports Server Professional and Enterprise editions. Starting from a predefined collection of fields, the Ad Hoc Editor lets you drag and drop fields, dimensions, and measures to explore data and create tables, charts, and crosstabs. These Ad Hoc views can be saved as reports. Ad Hoc Report In previous versions of JasperReports Server, a report created through the Ad Hoc Editor. Such reports could be added to dashboards and be scheduled, but when edited in iReport, lost their grouping and sorting. In the current version, the Ad Hoc Editor is used to explore views which in turn can be saved as reports. Such reports can be edited in iReport and Jaspersoft Studio without loss, and can be scheduled and added to dashboards. Ad Hoc View A view of data that is based on a Domain, Topic, or OLAP client connection. An Ad Hoc view can be a table, chart, or crosstab and is the entry point to analysis operations such as slice and dice, drill down, and drill through. Compare OLAP View. You can save an Ad Hoc view as a report in order to edit it in the interactive viewer, schedule it, or add it to a dashboard. Analysis View See OLAP View. Audit Archiving To prevent audit logs from growing too large to be easily accessed, the installer configures JasperReports Server to move current audit logs to an archive after a certain number of days, and to delete logs in the archive after a certain age. The archive is another table in the JasperReports Servers repository database. Audit Domains A Domain that accesses audit data in the repository and lets administrators create Ad Hoc reports of server activity. There is one Domain for current audit logs and one for archived logs. Audit Logging When auditing is enabled, audit logging is the active recording of who used JasperReports Server to do what when. The system installer can configure what activities to log, the amount of detail gathered, and when to archive the data. Audit logs are stored in the same private database that JasperReports Server uses to store the repository, but the data is only accessible through the audit Domains. Auditing A feature of JasperReports Server Enterprise edition that records all server activity and allows administrators to view the data.

181

JasperReports Server Administrator Guide Calculated Field In a Domain, a field whose value is calculated from a user-written formula that may include any number of fields, operators, and constants. A calculated field is defined in the Domain Designer, and it becomes one of the items to which the Domains security file and locale bundles can apply. CRM Customer Relationship Management. The practice of managing every facet of a companys interactions with its clientele. CRM applications help businesses track and support their customers. CrossJoin An MDX function that combines two or more dimensions into a single axis (column or row). Cube The basis of most OLAP applications, a cube is a data structure that contains three or more dimensions that categorize the cubes quantitative data. When you navigate the data displayed in an OLAP view, you are exploring a cube. Custom Field In the Ad Hoc Editor, a field that is created through menu items as a simple function of one or two available fields, including other custom fields. When a custom field becomes too complex or needs to be used in many reports, it is best to define it as a calculated field in a Domain. Dashboard A collection of reports, input controls, graphics, labels, and web content displayed in a single, integrated view. Dashboards often present a high level view of your data, but input controls can parameterize the data to display. For example, you can narrow down the data to a specific date range. Embedded web content, such as other web-based applications or maps, make dashboards more interactive and functional. Derived Table In a Domain, a derived table is defined by an additional query whose result becomes another set of items available in the Domain. For example, with a JDBC data source, you can write an SQL query that includes complex functions for selecting data. You can use the items in a derived table for other operations on the Domain, such as joining tables, defining a calculated field, or filtering. The items in a derived table can also be referenced in the Domains security file and locale bundles. Data Policy In JasperReports Server, a setting that determines how the server processes and caches data used by Ad Hoc reports. Select your data policies by clicking Manage > Ad Hoc Settings. Data Source Defines the connection properties that JasperReports Server needs to access data. The server transmits queries to data sources and obtains datasets in return for use in filling reports and previewing Ad Hoc reports. JasperReports Server supports JDBC, JNDI, and Bean data sources; custom data sources can be defined as well. Dataset A collection of data arranged in columns and rows. Datasets are equivalent to relational results sets and the JRDataSource type in the JasperReports Library. Datatype In JasperReports Server, a datatype is used to characterize a value entered through an input control. A datatype must be of type text, number, date, or date-time. It can include constraints on the value of the input, for example maximum and minimum values. As such, a datatype in JasperReports Server is more structured than a datatype in most programming languages. Denormalize A process for creating table joins that speeds up data retrieval at the cost of having duplicate row values between some columns.

182

Glossary Dice An OLAP operation to select columns. Dimension A categorization of the data in a cube. For example, a cube that stores data about sales figures might include dimensions such as time, product, region, and customers industry. Domain A virtual view of a data source that presents the data in business terms, allows for localization, and provides data-level security. A Domain is not a view of the database in relational terms, but it implements the same functionality within JasperReports Server. The design of a Domain specifies tables in the database, join clauses, calculated fields, display names, and default properties, all of which define items and sets of items for creating Ad Hoc reports. Domain Topic A Topic that is created from a Domain by the Data Chooser. A Domain Topic is based on the data source and items in a Domain, but it allows further filtering, user input, and selection of items. Unlike a JRXML-based Topic, a Domain Topic can be edited in JasperReports Server by users with the appropriate permissions. Drill To click on an element of an OLAP view to change the data that is displayed:

Drill down. An OLAP operation that exposes more detailed information down the hierarchy levels by delving deeper into the hierarchy and updating the contents of the navigation table. Drill through. An OLAP operation that displays detailed transactional data for a given aggregate measure. Click a fact to open a new table beneath the main navigation table; the new table displays the low-level data that constitutes the data that was clicked. Drill up. An OLAP operation for returning the parent hierarchy level to view to summary information.

Eclipse An open source Integrated Development Environment (IDE) for Java and other programming languages, such as C/C++. ETL Extract, Transform, Load. A process that retrieves data from transactional systems, and filters and aggregates the data to create a multidimensional database. Generally, ETL prepares the database that your reports will access. The Jaspersoft ETL product lets you define and schedule ETL processes. Fact The specific value or aggregate value of a measure for a particular member of a dimension. Facts are typically numeric. Field A field is equivalent to a column in the relational database model. Fields originate in the structure of the data source, but you may define calculated fields in a Domain or custom fields in the Ad Hoc Editor. Any type of field, along with its display name and default formatting properties, is called an item and may be used in the Ad Hoc Editor. Frame A dashboard element that displays reports or custom URLs. Frames can be mapped to input controls if their content can accept parameters. Group In a report, a group is a set of data rows that have an identical value in a designated field.

In a table, the value appears in a header and footer around the rows of the group, while the other fields appear as columns. In a chart, the field chosen to define the group becomes the independent variable on the X axis, while the other fields of each group are used to compute the dependent value on the Y axis.

Hierarchy Level In an OLAP cube, a member of a dimension containing a group of members.

183

JasperReports Server Administrator Guide Input Control A button, check box, drop-down list, text field, or calendar icon that allows users to enter a value when running a report or viewing a dashboard that accepts input parameters. For JRXML reports, input controls and their associated datatypes must be defined as repository objects and explicitly associated with the report. For Domain-based reports that prompt for filter values, the input controls are defined internally. When either type of report is used in a dashboard, its input controls are available to be added as special content. iReport Designer An open source tool for graphically designing reports that leverage all features of the JasperReports Library. The Jaspersoft iReport Designer lets you drag and drop fields, charts, and sub-reports onto a canvas, and also define parameters or expressions for each object to create pixel-perfect reports. You can generate the JRXML of the report directly in iReport, or upload it to JasperReports Server. iReport is implemented in NetBeans. Item When designing a Domain or creating a Topic based on a Domain, an item is the representation of a database field or a calculated field along with its display name and formatting properties defined in the Domain. Items can be grouped in sets and are available for use in the creation of Ad Hoc reports. JasperReport A combination of a report template and data that produces a complex document for viewing, printing, or archiving information. In the server, a JasperReport references other resources in the repository:

The report template (in the form of a JRXML file) Information about the data source that supplies data for the report Any additional resources, such as images, fonts, and resource bundles referenced by the report template.

The collection of all the resources that are referenced in a JasperReport is sometimes called a report unit. End users usually see and interact with a JasperReport as a single resource in the repository, but report creators must define all of the components in the report unit. JasperReports Library An embeddable, open source, Java API for generating a report, filling it with current data, drawing charts and tables, and exporting to any standard format (HTML, PDF, Excel, CSV, and others). JasperReports processes reports defined in JRXML, an open XML format that allows the report to contain expressions and logic to control report output based on run-time data. JasperReports Server A commercial open source, server-based application that calls the JasperReports library to generate and share reports securely. JasperReports Server authenticates users and lets them upload, run, view, schedule, and send reports from a web browser. Commercial versions provide metadata layers, interactive report and dashboard creation, and enterprise features such as organizations and auditing. Jaspersoft ETL A graphical tool for designing and implementing your data extraction, transforming, and loading (ETL) tasks. It provides hundreds of data source connectors to extract data from many relational and non-relational systems. Then, it schedules and performs data aggregation and integration into data marts or data warehouses that you use for reporting. Jaspersoft OLAP A relational OLAP server integrated into JasperReports Server that performs data analysis with MDX queries. The product includes query builders and visualization clients that help users explore and make sense of multidimensional data. Jaspersoft OLAP also supports XML/A connections to remote servers. Jaspersoft Studio An open source tool for graphically designing reports that leverage all features of the JasperReports Library. Jaspersoft Studio lets you drag and drop fields, charts, and sub-reports onto a canvas, and also define parameters or expressions for each object to create pixel-perfect reports. You can generate the JRXML of the report directly in JasperSoft Studio, or upload it to JasperReports Server. Jaspersoft Studio is implemented in Eclipse.

184

Glossary JavaBean A reusable Java component that can be dropped into an application container to provide standard functionality. JDBC Java Database Connectivity. A standard interface that Java applications use to access databases. JNDI Java Naming and Directory Interface. A standard interface that Java applications use to access naming and directory services. Join Tree In Domains, a collection of joined tables from the actual data source. A join is the relational operation that associates the rows of one table with the rows of another table based on a common value in given field of each table. Only the fields in a same join tree or calculated from the fields in a same join tree may appear together in a report. JPivot An open source graphical user interface for OLAP operations. For more information, visit http://jpivot.sourceforge.net/. JRXML An XML file format for saving and sharing reports created for the JasperReports Library and the applications that use it, such as iReport Designer and JasperReports Server. JRXML is an open format that uses the XML standard to define precisely all the structure and configuration of a report. MDX Multidimensional Expression Language. A language for querying multidimensional objects, such as OLAP (On Line Analytical Processing) cubes, and returning cube data for analytical processing. An MDX query is the query that determines the data displayed in an OLAP view. Measure Depending on the context:

In a report, a formula that calculates the values displayed in a tables columns, a crosstabs data values, or a charts dependent variable (such as the slices in a pie). In an OLAP view, a formula that calculates the facts that constitute the quantitative data in a cube.

Mondrian A Java-based, open source multidimensional database application. Mondrian Connection An OLAP client connection that consists of an OLAP schema and a data source. OLAP client connections populate OLAP views. Mondrian Schema Editor An open source Eclipse plug-in for creating Mondrian OLAP schemas. Mondrian XML/A Source A server-side XML/A source definition of a remote client-side XML/A connection used to populate an OLAP view using the XML/A standard. MySQL An open source relational database management system. For information, visit http://www.mysql.com/. Navigation Table The main table in an OLAP view that displays measures and dimensions as columns and rows.

185

JasperReports Server Administrator Guide ODBO Connect Jaspersoft ODBO Connect enables Microsoft Excel 2003 and 2007 Pivot Tables to work with Jaspersoft OLAP and other OLAP servers that support the XML/A protocol. After setting up the Jaspersoft ODBO data source, business analysts can use Excel Pivot Tables as a front-end for OLAP analysis. OLAP On Line Analytical Processing. Provides multidimensional views of data that help users analyze current and past performance and model future scenarios. OLAP Client Connection A definition for retrieving data to populate an OLAP view. An OLAP client connection is either a direct Java connection (Mondrian connection) or an XML-based API connection (XML/A connection). OLAP Schema A metadata definition of a multidimensional database. In Jaspersoft OLAP, schemas are stored in the repository as XML file resources. OLAP View Also called an analysis view. A view of multidimensional data that is based on an OLAP client connection and an MDX query. Unlike Ad Hoc views, you can directly edit an OLAP views MDX query to change the data and the way they are displayed. An OLAP view is the entry point for advanced analysis users who want to write their own queries. Compare Ad Hoc View. Organization A set of users that share folders and resources in the repository. An organization has its own user accounts, roles, and root folder in the repository to securely isolate it from other organizations that may be hosted on the same instance of JasperReports Server. Organization Admin Also called the organization administrator. A user in an organization with the privileges to manage the organizations user accounts and roles, repository permissions, and repository content. An organization admin can also create suborganizations and mange all of their accounts, roles, and repository objects. The default organization admin in each organization is the jasperadmin account. Outlier A fact that seems incongruous when compared to other members facts. For example, a very low sales figure or a very high number of helpdesk tickets. Such outliers may indicate a problem (or an important achievement) in your business. The analysis features of Jaspersoft OLAP excel at revealing outliers. Parameter Named values that are passed to the engine at report-filling time to control the data returned or the appearance and formatting of the report. A report parameter is defined by its name and type. In JasperReports Server, parameters can be mapped to input controls that users can interact with. Pivot To rotate a crosstab such that its row groups become column groups and its column groups become rows. In the Ad Hoc Editor, pivot a crosstab by clicking Pivot Table A table with two physical dimensions (for example, X and Y axis) for organizing information containing more than two logical dimensions (for example, PRODUCT, CUSTOMER, TIME, and LOCATION), such that each physical dimension is capable of representing one or more logical dimensions, where the values described by the dimensions are aggregated using a function such as SUM. Pivot tables are used in Jaspersoft OLAP. .

186

Glossary Properties Settings associated with an object. The settings determine certain features of the object, such as its color and label. Properties are normally editable. In Java, properties can be set in files listing objects and their settings. Report In casual usage, report may refer to:

A JasperReport. See JasperReport. The main JRXML in a JasperReport. The file generated when a JasperReport is scheduled. Such files are also called content resources or output files. The file generated when a JasperReport is run and then exported. In previous JasperReoprts Server versions, a report created in the Ad Hoc Editor. See Ad Hoc Report.

Repository The tree structure of folders that contain all saved reports, dashboards, OLAP views, and resources. Users access the repository through the JasperReports Server web interface or through iReport. Applications can access the repository through the web service API. Administrators use the import and export utilities to back up the repository contents. Resource In JasperReports Server, anything residing in the repository, such as an image, file, font, data source, Topic, Domain, report element, saved report, report output, dashboard, or OLAP view. Resources also include the folders in the repository. Administrators set user and role-based access permissions on repository resources to establish a security policy. Role A security feature of JasperReports Server. Administrators create named roles, assign them to user accounts, and then set access permissions to repository objects based on those roles. Certain roles also determine what functionality and menu options are displayed to users in the JasperReports Server interface. Schema A logical model that determines how data is stored. For example, the schema in a relational database is a description of the relationships between tables, views, and indexes. In Jaspersoft OLAP, an OLAP schema is the logical model of the data that appears in an OLAP view; they are uploaded to the repository as resources. For Domains, schemas are represented in XML design files. Schema Workbench A graphical tool for easily designing OLAP schemas, data security schemas, and MDX queries. The resulting cube and query definitions can then be used in Jaspersoft OLAP to perform simple but powerful analysis of large quantities of multidimensional data stored in standard RDBMS systems. Set In Domains and Domain Topics, a named collection of items grouped together for ease of use in the Ad Hoc Editor. A set can be based on the fields in a table or entirely defined by the Domain creator, but all items in a set must originate in the same join tree. The order of items in a set is preserved. Slice An OLAP operation for filtering data rows. SQL Structured Query Language. A standard language used to access and manipulate data and schemas in a relational database. System Admin Also called the system administrator. A user who has unlimited access to manage all organizations, users, roles, repository permissions, and repository objects across the entire JasperReports Server instance. The system admin can create root-level organizations and manage all server settings. The default system admin is the superuser account.

187

JasperReports Server Administrator Guide Topic A JRXML file created externally and uploaded to JasperReports Server as a basis for Ad Hoc reports. Topics are created by business analysts to specify a data source and a list of fields with which business users can create reports in the Ad Hoc Editor. Topics are stored in the Ad Hoc Components folder of the repository and displayed when a user launches the Ad Hoc Editor. Transactional Data Data that describe measurable aspects of an event, such as a retail transaction, relevant to your business. Transactional data are often stored in relational databases, with one row for each event and a table column or field for each measure. User Depending on the context:

A person who interacts with JasperReports Server through the web interface. There are generally three categories of users: administrators who install and configure JasperReports Server, database experts or business analysts who create data sources and Domains, and business users who create and view reports and dashboards. A user account that has an ID and password to enforce authentication. Both people and API calls accessing the server must provide the ID and password of a valid user account. Roles are assigned to user accounts to determine access to objects in the repository.

View Several meanings pertain to JasperReports Server:


An Ad Hoc view. See Ad Hoc View. An OLAP view. See OLAP View. A database view. See http://en.wikipedia.org/wiki/View_%28database%29.

Virtual Data Source A virtual data source allows you to combine data residing in multiple JDBC and/or JNDI data sources into a single data source that can query the combined data. Once you have created a virtual data source, you create Domains that join tables across the data sources to define the relationships between the data sources. WCF Web Component Framework. A low-level GUI component of JPivot. For more information, see http://jpivot.sourceforge.net/ wcf/index.html. Web Services A SOAP (Simple Object Access Protocol) API that enables applications to access certain features of JasperReports Server. The features include repository, scheduling and user administration tasks. XML eXtensible Markup language. A standard for defining, transferring, and interpreting data for use across any number of XMLenabled applications. XML/A XML for Analysis. An XML standard that uses Simple Object Access protocol (SOAP) to access remote data sources. For more information, see http://www.xmla.org/ XML/A Connection A type of OLAP client connection that consists of Simple Object Access Protocol (SOAP) definitions used to access data on a remote server. OLAP client connections populate OLAP views.

188

Index

INDEX
Symbols &theme parameter 97 A About JasperReports Server window 19 access control administering 46 authentication 16 authorization 17 object-level permissions 49 permissions 46 repository 12 Ad Hoc caching 124 comparison with Jaspersoft OLAP caching 127 data formats 173 data policies 122 date formats 173 fetch time 125 queries 121, 124 query time 125 result sets 124 views 121, 127, 148, 149 adding bean data sources 63 datatypes 67 folders 40 JDBC data sources 54 JNDI data sources 56 lists 68 queries 64 resources 41 virtual data sources 61 administering JasperReports Server See also access control. Ad Hoc 121124 auditing 141 bean data sources 63 chart themes 135 configuration files 107 crosstab limit 134 data policies 121, 122 data sources 53 datatypes 67 Domain validation 133 folders 40 fonts 81 general tasks 11 heartbeat 136 HTML exporter 135 HTML5 for Pro Charts 136 input controls 66 JAR files 81 JasperReports Library 134 JasperReports Server configuration 124 JDBC data sources 54 JNDI data sources 56 levels of administration 11 Liferay 159 lists 68 localization 167, 170, 174 logging in as a user 50 multiple administrators 12, 21 object-level permissions 49 online help 140 organizations 10, 21, 45 passwords 110, 112 portlets 162 queries 64, 121 report intervals 137 repository 11, 35, 45 resource bundles 82 resources 41 roles 14, 30 summary of tasks 21

189

JasperReports Server Administrator Guide


Talend Integration Suite 31 users 14, 16, 21, 25 virtual data sources 61 XHTML exporter 135 administrators general tasks 11 levels of administration 11 organization administrator 21 system administrator 11 Adobe Flash 136 Apache Hadoop. See Hive-Hadoop data sources. Apple iOS 136 Asian fonts 167, 178 attributes, profile. See profile attributes. auditing administering 141 archiving audit events 141, 144 audit reports 148 audited events 142 configuring 143 importing and exporting audit data 150 authentication. See access control. authorization. See access control. B beans. See data sources. big data 58, 123 browsing the repository 13 C caching. See Ad Hoc. cascading input controls 71 character encoding See also fonts, locales, and localization. encoding forms 176 JBoss 168, 169, 170 JDBC connections 177 JDBC data sources 169 JDBC drivers 169 JNDI data sources 169 MySQL 169 non-UTF-8 character encoding 176 OLAP data sources 177 OLAP views 177 Oracle databases 169 PostgreSQL 168 Tomcat 168, 170, 177 Unicode databases 177 UTF-8 167 charts, themes for 135 CLOB 138 configuring JasperReports Server. See administering JasperReports Server. copying folders 42 resources 14, 42 creating datatypes 67 folders 40 input controls 69 lists 68 queries 64 resources 14 crosstab report, Out of Memory errors 134 CSS files 88, 95 custom data sources 54 D data formats 173 data policies 121, 122 data sources administering 53 bean 63 combining. See virtual data sources. custom 54 JDBC 54 JNDI 56 queries 65 virtual 61 dataset caching 124 dataSnapshotService bean 129 datatypes administering 67 and input controls 69, 70 creating 67 for input controls 67 types 67 date formats 172, 173 defaults changing 107 chart themes 135 Domain validation 133 installation 10 Liferay ports 160 locale 170 Oracle character sets 169 Oracle synonyms 138 PDF fonts 179 report interval scheduling option 137 roles 30 time zone 175 users 25 deleting folders 44 resources 14, 44 demo. See Supermart. diagnostics 150 Domains adapting reports to audiences 64 JDBC column types 139 validation 133

190

Index
E editing folders and resources 42 events. See logging. exporting audit data 150 overview 99 resources 102 F Firebug plug-in 96 Flash 136 Folder Template 24, 95 folders creating 40 deleting 44 editing 42 Folder Template 24 moving 42 Public 13 fonts See also character encoding, locales, and localization. administering 81 East Asian 167, 178 in the repository 81 Jaspersoft OLAP 178 localization 177 multi-byte 167 non-UTF-8 fonts 176 OLAP views 178 PDF files 179 troubleshooting in exported files 81 format masks 172 Fusion Charts 136 G GlobalPropertiesList 109 H Hadoop-Hive data sources 58 heartbeat 18, 136 help configuration 140 Hive Query Language 54 HiveQL 66 HTML exporter 135 HTML5 136 I importing audit data 150 overview 99 resources 104 input controls adding 69 administering 66 and datatypes 67, 69, 70 cascading 71 creating 69 list of values for 68 list type 68 parameters for cascading input controls 77, 78 parameters for query-based input controls 77 query-based 71 saving 68, 69, 71 types 67 internationalization. See localization. iReport. See Jaspersoft iReport Designer. J JAR files, administering 81 JasperAnalysis. See Jaspersoft OLAP. JasperETL 31 JasperReports Library configuring 134 creating reports 9 extending 134 setting up hyperlinks 166 structure of a JasperReport 37 JasperReports Server configuration 124 plug-in for iReport 78 JasperServer. See administering JasperReports Server. Jaspersoft iReport Designer chart themes 135 creating reports with 9 resource bundles 171 setting up JasperReports Library hyperlinks 166 Jaspersoft OLAP 31, 127, 178 Java Management Extensions (JMX) 151 JBoss 168 JDBC data sources 54 JMX 151 JNDI data sources 56 JRXML files reference syntax. See repository. resource bundles 82 js-export command 102 js-import command 104 L languages. See localization. license expiration 19 Liferay configuring 159 examples 165 testing the configuration 161 lists administering 68 creating 68 list type input controls 68 locales See also character encoding, fonts, and localization. administering 174 character encoding 176 creating 170

191

JasperReports Server Administrator Guide


data formats 173 date formats 172, 173 format masks 172 non-UTF-8 character encoding 177 properties 170 resource bundles 170 time zones 175 localization See also character encoding, fonts, and locales. fonts 177 JasperReports Server 170 Jaspersoft iReport Designer 171 OLAP views 177, 178 UTF-8 167 logging audit events. See auditing. system events 129 logging in as a user 50 M maxFilterValues 128 mdxDataStrategy 128 MongoDB data sources 54 monitoring configuring 143 sample reports 149 moving folders 42 resources 14, 42 multi-byte fonts 167 multiple organizations. See organizations. MySQL 122, 169 N NVARCHAR2 139 O OLAP views 17, 177, 178 online help 140 Oracle character sets 169 CLOB 138 NVARCHAR2 139 synonyms 138 organizations admin roles 30 administering 21 default 10 folder structure 24 multiple 10, 21, 45 Organizations folder 24 Portal organizations 161 searching for 22 single 10, 21 suborganizations 11 Organizations folder 24 Out of Memory errors 134 overrides_custom.css file 89 P parameterized queries. See queries. passwords auditing 146 encrypting 112 expiration 110 users changing 111 PDF embedding fonts 179 troubleshooting fonts in 81 permissions. See access control. plug-in for iReport 78 port numbers 159 portlets and hyperlinks in reports 165 and Liferay 161 and multiple organizations 163 and web services 160, 161 changing the default report list 165 changing the logo 164 configuring 162, 163 deploying 162 integrating Liferay 159 parameters 164 port numbers 159 role 31, 163 testing 163 upgrading JasperReports Server 162 PostgreSQL 168 Pro Charts 136 profile attributes 28 and auditing 142 and query-based input controls 75 defined 17 updating in the database 28 viewing users 26 properties files creating 170 resource bundles 171 Public folder 13 Q queries administering 64 and Ad Hoc views 121, 124 creating 64 multiple query languages 66 parameters for cascading input controls 77 parameters for query-based input controls 77 query executors 66 saving 66 using 64 query-based input controls 71

192

Index
R repo syntax 38 reports and cascading input controls 80 creating 9 JasperReport 37 JasperReports Library 9 Jaspersoft iReport Designer 9 report intervals 137 scheduling 137 troubleshooting fonts in exported reports 81 repository See also resources. access control 12 administering 11, 35 browsing 13 configuring 45 design issues 45 encryption 112 events 146 folders 11 importing and exporting 99 Organizations folder 24 Public folder 13 reference syntax 38 referencing resources 45 resources 12, 38 sample data 12 searching 14, 32 structure 11 UTF-8 encoding 168, 169 resource bundles in the repository 82 See also localization. resources adding 14, 41 browsing 13 copying 14 cutting 14 deleting 14, 44 editing 42 fonts 81 importing and exporting 99 in repository 38 JAR files 81 moving 42 pasting 14 queries 64 resource bundles 82 resource references in JRXML files. See repository. searching 14 result sets 124 roles administering 14, 30 administrative 21 and users 30 default roles 30 object-level permissions 49 searching for 32 S saving input controls 68, 69, 71 queries 66 searching the repository 14, 32 session timeout 111 snapshotPersistenceEnabled 129 snapshotRecordingEnabled 129 suborganizations. See organizations. SuperMart demo and roles 31 support, finding product version 19 system admin roles 30 system logging 129 System Properties folder 109 T Talend Integration Suite (TIS EE) 31 themes See also chart themes. &theme parameter 97 active theme 87 CSS files 88, 95 custom overrides 89 default theme 87 downloading 94 Firebug plug-in 96 in the Folder Template 95 inheritance mechanism 88 inherited theme 87 Jaspersoft iReport Designer 135 permissions 92 recovering from inadvertent changes 97 sample galleries 97 system theme 87 Themes folder 87 uploading 94 URL parameter 97 ZIP archive 93 third-party APIs 81 time zones 175 Tomcat 168 translations 167 U Unicode Transformation Format (UTF-8). See character encoding. Universal Resource Identifiers (URI) 45 user interface samples 97 users administering 14, 16, 25 authenticating 16, 17, 46 changing passwords 111

193

JasperReports Server Administrator Guide


default users 25 logging in as 50 object-level permissions 49 roles 30 searching for 26 session timeout 111 V version of the software 19 Vertica databases 53 views 17 virtual data sources 61 W web services 144, 160 X XHTML exporter 135

194

You might also like