JasperReports Server Admin Guide
JasperReports Server Admin Guide
ADMINISTRATOR GUIDE
RELEASE 6.0
http://www.jaspersoft.com
Copyright 2005-2014, TIBCO Software Inc. All rights reserved. Printed in the U.S.A. TIBCO, the TIBCO
logo, TIBCO Jaspersoft, the TIBCO Jaspersoft logo, TIBCO Jaspersoft iReport Designer, TIBCO JasperReports
Library, TIBCO JasperReports Server, TIBCO Jaspersoft OLAP, TIBCO Jaspersoft Studio, and TIBCO Jaspersoft
ETL are trademarks and/or registered trademarks of TIBCO Software Inc. 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 1214-JSP60-22 of the JasperReports Server Administrator Guide.
TABLE OF CONTENTS
Chapter 1 Overview of JasperReports Server Administration
1.1 Overview of Organizations
1.1.1 Single Default Organization
1.1.2 Multiple Organizations
1.1.3 Levels of Administrators
1.2 Overview of the Repository
1.2.1 Folder Structure
1.2.2 Resources
1.2.3 Sample Data
1.2.4 Browsing and Searching
1.3 Overview of Users and Roles
1.3.1 Administering Users and Roles
1.3.2 Delegated Administration
1.4 Overview of Security
1.4.1 Authentication
1.4.2 Authorization Overview
1.5 Administrator Login
1.5.1 JasperReports Server Heartbeat
1.5.2 Administrator Email
1.6 Administrator Pages
Chapter 2 Organization, User, and Role Management
2.1 Managing Organizations
2.1.1 Viewing Organization Properties
2.1.2 Creating an Organization
2.1.3 Default Folders for Organizations
2.1.4 Editing an Organization
2.1.5 Creating Attributes on Organizations
2.1.6 Creating Attributes at the Server Level
2.1.7 Deleting an Organization
2.2 Managing Users
2.2.1 Viewing User Properties
2.2.2 Creating a User
11
12
12
13
13
14
14
14
15
16
17
17
18
18
19
20
21
21
22
22
25
25
27
27
28
28
29
30
31
32
32
33
34
35
37
37
38
39
40
41
41
43
44
46
46
46
47
48
48
48
49
50
50
51
52
53
54
55
55
55
56
57
57
58
59
59
59
60
60
62
65
66
66
67
68
70
73
75
78
78
80
81
83
86
89
90
90
91
91
92
95
95
98
99
99
102
102
106
108
109
110
111
115
116
116
116
117
117
119
119
120
122
123
123
124
125
126
127
128
129
129
131
131
131
132
132
133
133
135
135
136
136
137
137
138
139
141
141
143
145
146
146
146
149
150
150
151
151
153
154
155
156
156
157
157
158
159
159
161
161
163
163
164
164
165
167
167
169
171
171
171
171
172
173
173
175
176
179
180
182
182
183
185
185
187
188
193
194
194
195
196
196
197
198
199
199
199
203
204
204
206
206
207
207
209
210
210
211
212
212
213
213
214
215
215
216
217
219
220
220
221
222
223
224
226
226
229
230
231
231
232
233
233
235
237
238
238
240
241
241
242
242
242
243
243
243
244
245
247
249
249
250
250
251
251
252
253
253
254
254
255
255
256
256
257
257
257
258
258
259
260
260
260
261
261
262
262
263
263
264
264
265
266
266
266
267
267
268
268
269
269
270
270
271
271
274
275
275
277
277
278
278
Index
10
281
CHAPTER 1
Easily create new reports based on views designed in an intuitive, web-based, drag and drop Ad Hoc
Editor.
Efficiently and securely manage many reports.
Interact with reports, including sorting, changing formatting, entering parameters, and drilling on data.
Schedule reports for distribution through email and storage in the repository.
Arrange reports and web content to create appealing, data-rich Jaspersoft Dashboards that quickly convey
business trends.
For business intelligence users, Jaspersoft offers TIBCO Jaspersoft OLAP, an optional component of
JasperReports Server, controlled by license 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 either use TIBCO Jaspersoft Studio or manually write JRXML code to create a report that
can be run in the server. We recommend that you use Jaspersoft Studio unless you have a thorough
understanding of the JasperReports file structure.
You can use the following sources of information to extend your knowledge of JasperReports Server:
Our core documentation describes how to install, administer, and use JasperReports Server. Core
documentation is available as PDFs in the docs folder of your JasperReports Server installation. You can
also access PDF and HTML versions of these guides online from the Documentation section of the
Jaspersoft Community website.
Our Ultimate Guides document advanced features and configuration. They also include best practice
recommendations and numerous examples. These guides are available online in PDFand HTML from the
Documentation section of the Jaspersoft Community website.
Our Online Learning Portal lets you learn at your own pace, and covers topics for developers, system
administrators, business users, and data integration users. The Portal is available online from Professional
Services section of our website.
Our free samples, which are installed with JasperReports, Jaspersoft Studio, and JasperReports Server, are
documented online. The samples documentation can be found on our community website.
11
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.
Overview of Organizations
Overview of the Repository
Overview of Users and Roles
Overview of Security
Administrator Login
Administrator Pages
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 multi-organization architecture for hosting large BI deployments.
1.1
Overview of Organizations
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 may in turn have suborganizations, and
so on.
In the default JasperReports Server installation, a single organization mimics the simple structure of older
versions of JasperReports Server. If you want to deploy multiple organizations, you must be aware of certain
design considerations.
Organizations are not available in the community version of JasperReports Server.
1.1.1
12
1.1.2
Multiple Organizations
There are many use cases for defining multiple organizations in JasperReports Server. For instance:
The organization feature is flexible enough to accommodate any combination of these scenarios and many
others like it. In all cases, administrators can configure secure environments for any number of organizations,
and end-users experience a powerful BI platform tailored to their needs.
All organizations or hierarchies of organizations exist independently within a single instance of JasperReports
Server. Neighboring organizations are isolated from one another, while parent organizations have full control of
their suborganizations. Users can access only the data and resources in their own organizations or
suborganizations, and administrators can define roles and set permissions to further control access.
1.1.3
Levels of Administrators
Each organization has an administrator who can manage users, roles, and repository permissions in that
organization and any of its suborganizations.
There are essentially three levels of administration:
The system administrator Also called system admin. The default login name 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 limited to
the suborganizations's users, roles, and repository objects. This administrator can be overridden by a toplevel organization admin.
13
1.2
1.2.1
Folder Structure
The root of the repository tree structure is accessible only to the system admin logged in as superuser in the
commercial edition, or jasperadmin in the community edition. The tree contains the folders for each
organization and folders for certain configuration settings.
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 Jaspersoft Studio, are uploaded from files. Others,
such as data sources and Domains1, are created in JasperReports Server itself. Of course, dashboards, data views,
1A domain is a configured data source with selected joins, tables, and fields from your data base.
14
and reports can also be saved in the repository to be run as often as needed. Output such as PDF or HTML can
be saved in the repository as well.
All resources, including folders, have unique IDs, names, and optional descriptions. The ID of a resource, along
with the ID of its enclosing folder comprise the path used to reference that resource. The name and description
appear in the user interface when you browse or search the repository.
Resources are stored in an internal format not accessible to users or administrators. Any resource can 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 Overview of Users and Roles
on page17.
1.2.3
Sample Data
When you install the sample data in JasperReports Server, the default organization (Organization) has sample
content. Below you'll see the System Admin and Organization Admin views of sample the data.
System admin (superuser) 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.
15
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
16
Search - Enter a search term in the search field at the top of any page, or select View > Search Results.
1.3
1.3.1
17
1.3.2
Delegated Administration
JasperReports Server enables three levels of delegated administration:
In the case of true delegated administration, three factors 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, 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 can assign this role 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.
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.
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 that 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 Permissions on page57.
1.4
Overview of Security
JasperReports Server ensures that people can access only 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:
18
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 settings 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 Managing Users on page32.
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 Managing
Roles on page38.
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)
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 Studio and for XML/A traffic. The server can automatically
synchronize with an 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.
19
1.4.2
Authorization Overview
With a users identity and roles established, JasperReports Server controls the users access in these ways:
Menu options and
pages
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.
Organization scope
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 Multiple Organizations in the Repository on page55.
Resource permissions
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, readwrite-delete, and administer (see Permissions on page57).
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.
Administrator privileges
20
Data-level security
Data-level security determines the data that 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. Data-level 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.
attributes
1.5
Administrator Login
Administrators log in on the standard login page, using the following default passwords:
Commercial editions:
Community project:
For security reasons, always change the default administrator passwords immediately after installing
JasperReports Server. For instructions, see Editing a User on page34.
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
21
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 jasperadminaccounts.
To set the email and passwords on the administrator accounts, edit the user account information as described in
Editing a User on page34.
1.6
Administrator Pages
Administrators have access to special pages to manage the server. After logging in, click View options in the
Admin box on the Getting Started page or select an item from the Manage menu on any page.
System admin:
Organization admin:
22
Figure 1-6 Manage Server Page for System Admins in Commercial Editions (superuser)
The About JasperReports Server link in the footer of all pages displays the product version along with the
software build, and your license type and expiration. Please have this information available if you need to
contact Jaspersoft for support.
23
24
CHAPTER 2
In a single-organization deployment, the administrator needs to create only the users and roles. In deployments
with multiple organizations, administrators need to create organizations, populate them with users, and create
the roles they use afterward to set access permissions.
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 deployment with multiple organizations, there can be administrators at every level of the hierarchy, as
described in Delegated Administration on page18. Part of any large deployment is to designate the
administrators 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 ensures that an organization
administrator cannot see roles and users from parent organizations.
This chapter contains the following sections:
2.1
Managing Organizations
Managing Users
Managing Roles
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, and 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.
25
The following figure shows the organizations 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 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.
26
2.1.1
2.
3.
To select an organization, click its parent in the left Organizations panel, then select the organization in the
center panel. If there are many organizations, you can search for a specific organization, but the search will
find only organization in the center Organizations panel.
4.
Once you select an organization, the Properties panel on the right shows information about it:
2.1.2
Name Display name of the organization that appears on the organizations top folder.
ID Unique and permanent organization ID used for logging into it.
Alias Unique but editable short organization name that can also be used when logging in.
Description Optional description that appears only 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 Count 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.
Creating an Organization
1.
Log in as a user with administrative privileges for the parent of the new organization.
2.
3.
4.
27
5.
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 needed before saving the organization. Once saved, the organization ID can no
longer be modified. The Description is optional. The previous figure shows this dialog with sample values.
6.
The properties panel shows the number of users and roles in the organization and provides 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 Managing Users on page32.
2.1.3
The organization has no roles of its own. The default users have the system-wide roles ROLE_USER and
ROLE_ADMINISTRATOR.
In the repository, a new folder is created in the parents Organization folder. This new organization folder
contains a copy of the parents Organization/Folder Template folder. To manage the Organization folders,
select View > Repository.
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.
Templates A folder that holds templates used when generating reports from Ad Hoc views.
Themes A special folder managed by the system to contain CSS files that define the appearance of 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 Folder Templates for use in creating suborganizations.
Finally, the Folder Template itself is copied into a new organization, so each new suborganization has the same
default folders and resources as its parent.
2.1.4
Editing an Organization
1.
28
2.
3.
4.
In the Properties panel, click Edit so you can change the organizations properties.
Edit the organization properties as needed. Changing the organization name changes the name of the
organizations folder, as well, but no other data. You can change the alias and description. The organization
ID is value defined when the organization was created.
6.
2.1.5
2.
3.
29
GET http://<host>:<port>/jasperserver-pro/rest_v2/organizations/organizationID/attributes?
name=Attr1&name=Attr2&...
To view single attributes on an organization, add the attribute name to the request above:
GET http://<host>:<port>/jasperserver-pro/rest_v2/organizations/organizationID/attributes/Attr3
4.
To create attributes on an organization, or to replace all of its exisiting attributes, send this REST API
request:
PUT http://<host>:<port>/jasperserver-pro/rest_v2/organizations/organizationID/attributes
{
"attribute":[
{
"name": "Attr1",
"value":"Value1"
},
{
"name": "Attr2",
"value":"Value2a, Value2b"
},
{
"name": "Attr3",
"value":"Value3"
"secure":"true"
},
...]
}
5.
To add one attributes on an organization, or to change the value of an existing attribute, send this REST
API request. The attribute name in the URLmust match the one in the content:
PUT http://<host>:<port>/jasperserver-pro/rest_v2/organizations/organizationID/attributes/Attr1
{
"name": "Attr1",
"value":"newValue1"
}
6.
2.1.6
30
Select View > Repository and open the System Properties folder at the root.
Right click the GlobalPropertiesList resource and select Edit from the context menu.
The GlobalPropertiesList is a list of name-value attribute pairs. Some of the attributes are used internally,
such as JDBC driver names and configuration settings. New attributes defined here have the same behavior
as server-level attributes.
Use the fields to enter new attribute name-value pairs, and click Add to create new attributes.
5.
6.
Click Remove to delete a server-level attribute. Do not remove attributes defined by the system.
To modify an attribute, remove it first, then add it with the same name and a new value.
7.
When secure attributes appear in the GlobalPropertiesList, their value is shown as *** symbols. The
GlobalPropertiesList does not support adding a secure attribute. To add a secure server-level attribute, use
the procedure in 2.1.5, Creating Attributes on Organizations, on page29, but specify the
RESTAPIrequest as follows:
PUT http://<host>:<port>/jasperserver-pro/rest_v2/attributes/Attr3
{
"name": "Attr3",
"value":"Value3"
"secure":"true"
}
You can also create, edit, and delete server-level attributes using the REST v2 API. For more information about
these REST APIrequests, see the corresponding section of the JasperReports Server Web Services Guide.
2.1.7
Deleting an Organization
1.
31
2.
3.
2.2
Managing Users
As with organizations, system admins can manage all users in all organizations and create users outside of
organizations, as described in Delegated Administration on page18. Organization admins can manage only
the users in the organizations they administer.
The default installation of JasperReports Server includes the following users:
Table 2-1 Default Users in JasperReports Server Installations
User Name
Default Password
(case sensitive)
Organization
Description
superuser
superuser
none
anonymousUser
anonymoususer
none
jasperadmin
jasperadmin
Organization
joeuser
joeuser
Organization
demo
demo
Organization
CaliforniaUser
CaliforniaUser
Organization
You should advise your users to change their passwords regularly. To configure periodic expiration of
passwords, refer to Configuring User Password Options on page155.
Some editions of the server do not include all these users; for example, superuser is not included in the
Community edition of the server, and demo and CaliforniaUser are included only if you install the
sample data.
2.2.1
32
2.
Select Manage > Users or, on the Admin Home page, click Users. The Manage Users page displays the
users in each organization and properties of the selected user.
To locate a user:
4.
Browse for users. Expand the organization hierarchy in the left-panel, and select an organization or
suborganization.
Search for a 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 usernames in the selected organization and
suborganizations that match the search string.
Select a user to view attributes in the Properties panel.
User status can be Enabled or Disabled; disabled users are displayed in gray text in the Users list. 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 Managing Roles on page38.
2.2.2
Creating a User
1.
Log in as a user with administrative privileges for the organization to which the user will belong.
2.
Select Manage > Users or, on the Admin Home page, click Users.
3.
In the Organizations panels, select the organization for the new user and click Add User. For community
edition admins, simply click Add User. The Add User dialog appears.
33
5.
User name The new user's full name. The name is optional but recommended; It will appear in the top
right-corner of the UI when the user is logged in.
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. The User ID must be unique within the organization, but may exist in multiple
organizations.
Email This is optional but must be in a valid email format.
Password and confirmation Enter and confirm a password for the user.
User is enabled To enable the user to log in, select this checkbox. Users who are not enabled can't
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 Managing Roles on page38.
Click Add User to <organization> (Add User for community edition).
The new user is available in the Users panel. To assign roles to the user, click Edit in the user's Properties
panel.
2.2.3
Editing a User
One way to assign roles to a user is to edit the user's properties. Alternatively, when you edit a role, you can
assign it to any number of users. To edit a user's properties:
34
1.
2.
3.
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
step4.)
4.
5.
Edit the user's properties as needed. You can't edit the user ID; it always has the value defined when the
user is created originally.
7.
To assign or remove roles from the user, select the roles, and use 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 system-wide roles. For more information on creating and adding roles, see Managing Roles on
page38.
8.
9.
In the Properties panel, click Login as User to test the users permissions, as explained in Testing User
Permissions on page62.
Logging in as another user is also necessary when you are maintaining resources that use absolute
references in the repository. For more information, see Referencing Resources in the Repository on
page56.
2.2.4
35
As of version 5.0, we recommend using the user interface to add, edit, and delete user profile attributes instead
of accessing the private repository database.
To add, edit, or remove user attributes:
1. Log in as a user with administrative privileges for the users organization.
2.
3.
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
step4.)
4.
5.
In the Properties panel, click Edit and select the Attributes tab at the top of the panel.
To create a new attribute, enter an attribute name and attribute value(s) and click Add. Use commas to
separate multiple attribute values.
You cannot define two attributes with the same name.
36
7.
8.
9.
Click Save.
2.2.5
2.
3.
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.
4.
In the Users list use Control-click and Shift-click to make multiple selections. If the User list is too long,
enter a search term to find users and enable or disable them individually.
5.
2.2.6
2.
3.
Click Manage > Users or, on the Admin Home page, click Users.
In the Organizations panel, select the users organization; to delete users in different organizations, select
the common parent organization.
4.
In the Users list 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.
5.
In the tool bar of the Users panel, click Delete and confirm the action.
37
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 Permissions on page57). 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 Default Roles in JasperReports Server Installations
38
Role
Description
ROLE_SUPERUSER
ROLE_ADMINISTRATOR
ROLE_USER
ROLE_ANONYMOUS
ROLE_PORTLET
ROLE_DEMO
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.
Role
Description
ROLE_SUPERMART_
MANAGER
ROLE_ETL_ADMIN
Except for the five special system-level roles visible in every organization, roles are defined within
organizations. A single role ID can be defined in multiple 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
2.
Select Manage > Roles or, on the Admin Home page, click Roles. The Manage Roles page displays the
roles in each organization and properties for each role.
39
The Roles list includes all roles in the chosen organization and its suborganizations along with the five
default system-level roles. The same role name may appear more than once if 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 step4.) The Roles panel is displayed.
4.
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's defined, and the users assigned the
role. Hover over a user ID to see a user's full name and organization, as shown in Figure 2-11.
When you view the properties of a special system-level role, you only see the users with that role in your
organization or any suborganization. An organization admin can never see users outside of his
organization or its suborganizations.
2.3.2
Creating a Role
1.
Log in as a user with administrative privileges for the organization in which the role will be used.
2.
3.
Select Manage > Roles or, on the Admin Home page, click Roles.
In the Organizations panel, select the organization to which the role will belong. (Commercial users only.
Community users skip to step 4.)
4.
6.
Click Add Role to <organization> (Add Role for community edition users) to create the role.
The new role is included in the Roles panel. If you want to assign users to the role, click Edit in the
Properties panel of the new role.
40
2.3.3
Log in as a user with administrative privileges for the organization in which the role is defined.
2.
3.
Select Manage > Roles or, on the Admin Home page, click Roles.
In the Organizations panel, select the roles organization. (Commercial users only. Community users skip to
step 4.) The Roles panel is displayed.
4.
5.
In the Properties panel, click Edit. The roles properties become editable. .
Enter a different name to change the role name throughout the server.
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.
To assign or remove role users, select the users, and click the arrow buttons between the Users Available
and Users Assigned lists.
8.
2.3.4
Log in as a user with administrative privileges for the organization in which the role is defined.
41
2.
3.
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.
4.
Select the role in the Roles panel. Use Control-click and Shift-click to make multiple selections.
Unless you're logged in as the system admin, you can't edit or delete the five special system-level roles.
5.
42
In the tool bar of the Roles panel, click Delete and confirm the action.
CHAPTER 3
REPOSITORY ADMINISTRATION
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 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 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.
The repository is structured as a hierarchy of folders 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:
You can also access the repository using the web services (see the JasperReports Server Web Services Guide)
and APIs (see the JasperReports Server Ultimate Guide).
This chapter contains the following sections:
Resource Types
JasperReport Structure
Managing Folders and Resources
Multiple Organizations in the Repository
Permissions
43
3.1
Resource Types
Resource types are based on various reports and report elements that users and administrators store in the
repository.
Two fundamental resource types are those end users can create, and those administrators must create. Procedures
for end users to create resources are described in the JasperReports Server User Guide. End users create the
following resources:
Table 3-1 Resources Created by End Users
Resource Type
Description
Ad Hoc view
Professional edition only. Users Create Ad Hoc views interactively in the Ad Hoc
Editor by dragging and dropping columns of data onto a table, chart, or crosstab.
Users can 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.
Dashboard
Content resource
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.
JasperReport or simply
report
A report combines a JRXML file, a data source, and optional components such as
input controls. Users can run reports in the server. Depending on the use case,
both users and administrators create JasperReports in the server. For more
information, see JasperReport Structure on page46. Optionally, reports may
also store a snapshot of the report data to improve performance when many users
access the same reports.
Report version
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.
The other types of resources are all created and managed in the repository by administrators. The following
resources generally support the report creation:
Table 3-2 Resources Created by Administrators
44
Resource Type
Description
Data source
A connection that points to a database or other data store. Data sources define
where data is stored for reporting. 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 Data Sources on page65.
Resource Type
Description
Datatype
A basic resource 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.
Domain
A metadata layer that selects, joins, and filters tables and fields from your data. 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.
File
A resource that stores data in the repository. File Resource Types on page115
gives the list of supported file formats and their purpose.
Input Control
A complex type that specifies the 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.
List of Values
A basic resource 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 a value 1 to
12.
Query
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.
Administrators can 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
Resource Type
Description
Specifies 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).
OLAP View
45
3.2
JasperReport Structure
The repository resource 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 the server uses to
render reports.
A JasperReport is a complex resource composed of other resources:
The collection of all the resources 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
3.2.2
Absolute References
Absolute references are the URIs of resources in the JRXML of a report. A path may refer to the file system
where the JRXML was created, but when uploaded to the server, it refers to folders in the repository.
The path must start with one of the following:
/ to represent the root of the repository in the community edition, or the current user's organization in
commercial editions. For example, /images/logo is the path to a resource in the /images folder.
46
../ to represent the folder where the JasperReport is uploaded. For example, ../myLogo is the path to a
When uploading the JRXML with absolute resource references as part of a JasperReport in the server, you need
to ensure only 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
When you upload a JRXML with this reference, the server prompts you to provide the resource. You have two
options:
Create a new resource, in this case by uploading an image that becomes part of the JasperReport. This is
called a local resource. You can't access this resource from elsewhere in the repository, it exists only within
the JasperReport.
Select a resource from the repository. This is called an external reference because it is external to the
JasperReport. Any number of reports can link to the same external resource, and the resource can be
managed independent 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 a JasperReport, and external references cannot be deleted until
they are no longer referenced.
In cases where you dont want to reference existing resources, local resources allow reports to be highly
customized and self-contained. A local resource defined inside the JasperReport has all the same properties as a
repository resource, but it's not accessible in the repository. Users must edit the JasperReport to access any
resources it defines locally.
Users who are not administrators can 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.
47
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 to either create a new
local resource or use 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 local query
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.
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 have an external reference
to its datatype. The server still manages the dependency between the local input control and the datatype
resource in the repository.
Local resources and external references are used throughout the repository, for example when creating input
controls, query resources, Domains, and OLAP resources.
3.2.4
References in Subreports
A subreport is a subordinate JRXML file within a JasperReport. As with all other resources referenced by the
main JRXML, the subreport JRXML file may be specified by an absolute reference, a local resource or an
external reference.
As a JRXML file, a subreport can reference other resources of its own. However, the subreport is run as part of
the main JRXML, and any references in the subreport are interpreted relative to the JasperReport resource
(represented by the main JRXML) and the context in which the JasperReport is being run.
3.2.5
Data Snapshots
Since JasperReports Server 4.7, report resources can 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 not
visible or 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 Enabling Data Snapshots on page194.
3.3
48
write permission. Users with write permission can also create their own sub-folders to store their reports and
dashboards.
Only administrators can create shared data sources and other resources in the repository. So, although users with
write permission can upload JRXML files and define resources inside JasperReports, they can't add these
resources to the repository and share them. For this reason, we recommend that administrators create shared data
sources and resources in the repository. For example, updating one shared logo file is better than many users
editing their reports.
3.3.1
Resource IDs
Each resource, including each folder, has an ID, a name, and an optional description:
The ID is used internally to reference a resource. The ID must be unique within its folder, but may exist in
multiple folders.
The resource name is displayed in the repository.
The description, if defined, appears in the repository and in tooltips.
As in a file system, the IDs of nested folders containing a resource define the path to the resource. 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's name or the resource in the repository
or search results and select Properties... from the context menu.
49
3.3.2
Creating Folders
Any user with write permission on a folder can create new sub-folders.
To create a folder:
1. Log on as a user who has write permission to the parent folder.
2.
Select View > Repository and locate the parent folder in the Folders panel.
3.
Right-click the parent folder and select Add Folder from the context menu. The Add Folder dialog
appears.
Enter the folder name and, optionally, a description, then click Add.
The folder is created in the repository. The name appears in the hierarchy of folders. The description is
visible only 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. Users with
Administrator permissions can change permissions folders, as described in Setting Permissions on
page60.
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. The procedures for adding each type are available in the resources below:
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
Commercial Edition 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 the chapter Other Resources in
the Repository on page95
Most resources are created through the Add Resource menu item on the context menu for folders in the
repository. In the following figure, you can see the full menu and submenu with all the resources administrators
can create:
50
3.3.4
In the repository, browse or search for the resource. For renaming folders, select View > Repository and
locate the folder.
3.
Right-click the object and select Properties... from the context menu. The Properties dialog appears.
51
3.3.5
52
2.
Click View > Repository, and expand the folders to display the object to be copied or moved.
3.
Right-click the resource and select Copy or Cut. (Delete permission is required to move a resource.)
You can select multiple resources with Control-click or Shift-click, but only a single folder.
4.
Right-click the destination folder and select Paste in the context menu. If the Paste. (Write permission on
the destination folder is required.)
Alternatively, you can drag to move the selected resource or folder to the destination folder. To copy, press
and hold the Ctrl key then click and drag. When dragging resources, the destination folder is highlighted in
blue if you have write permission to it.
3.3.6
Editing Resources
Resource editing methods differ by the resource type. 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 End Users Can Edit
Resource Type
How to Edit
Ad Hoc view
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.
Content Resource
Report output is a file stored in the repository. These files cannot be edited, only
downloaded or deleted.
JasperReport
Users or administrators select Edit and change the data source, input controls, or
file resources referenced in the JasperReport. For more information, see
JasperReport Structure on page46.
When users Run a report, it's displayed in the interactive report viewer. If data
snapshots are enabled, the report is displayed with data that was previously
returned 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 their permissions.
Report Version
Professional edition only. Users may select Edit to change the values stored as
input parameters.
53
How to Edit
Data Source
Administrators select Edit from the context menu on these resources. You edit
these resources in the same dialog you used to create them.
Datatype
You can view the current definition of a resource or change its values. For example,
you could view the datatype of an input control, change a query, or upload a new
file in a file resource.
Domain
File
Input Control
List of Values
Query
For a Domain, you 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 them in Other
Resources in the Repository on page95.
3.3.7
You can't change a resource's ID. If you need to change an ID, you have to create a new resource and delete
the old one.
You can't change the location of a resource. To change the location of the resource, see Copying and
Moving on page52.
For file resources, you can't 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.
The repository won't allow you to delete resources currently referenced by other resources. For example, an
input type used by a report or a properties file 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. Log on as a user who has delete permission for the folder or resource.
54
2.
3.
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 delete only one folder at a time, but all contents of that folder will be
deleted. In the search results, you can select multiple resources and right-click to select Delete in the
context menu.
3.4
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 a user's view and access to their organizations folder. Organization
admins can create any folder structure needed within the organization.
Top-level organizations are contained in a folder called Organizations at the root of the folder hierarchy. The
top folder of an organization is contained in a folder called Organizations in the parent organization.
Administrators can view and browse the Organizations folder, and the folders of any suborganizations. As
administrators of the parent organization, they can also create folders and resources in suborganizations.
By default, users in an organization can also view and create folders and resources in any
suborganization. An administrator can prevent this, by changing the folder permissions.
The Organizations folder in every organization is a special folder that is managed by the server. Administrators
can't 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 Default Folders for
Organizations on page28
3.4.2
Design Considerations
Careful design of the JasperReports Server repository leads to a clear and robust BI environment and easy, 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 those specific to an organization. Consider these
use cases:
Organizations have private resources - Separate data sources, reports, OLAP views etc. 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 among 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.
55
3.4.3
Organizations are hierarchical - One organization contains others. 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.
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.
So 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 works only 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.
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:
For maintenance tasks on an organizations report units, OLAP views and OLAP connections, you must log
into 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 log in as an admin of the organization using the references.
See Testing User Permissions on page62.
56
3.4.4
Best Practices
Here are some best practices for resources in a repository shared by multiple organizations:
3.5
The system admin must log in as an organization user to maintain or run an organization's resources.
Resources with absolute references to resources in organization folders work only for the users within the
organization or the parent organization.
If a JRXML that accesses organization resources with URIs must run across organizations, 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.
Permissions
Permissions on folders and resources determine what users see in the repository and what actions they're allowed
to perform. In the following table, the actions granted by each permission include all of the actions granted by
permissions above it, except for the No Access permission. The actions granted by each permission strictly
exclude all of the actions granted by permissions below it.
Permission
No Access
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.
Execute Only
Users can never see the folder or resource in the repository, but the reports,
dashboard, or OLAP views that they run can access them.
Read Only
Read + Delete
Read + Write
57
Permission
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
Administer
Set the permissions (by role and by user) on a folder or resource. This
effectively delegates certain repository administration tasks.
Permissions apply when browsing or searching the repository and when using any dialog that accesses the
repository, like browsing folders to save a report. Note that:
3.5.1
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 Copying and Moving on page52
Copying and cutting (moving) actions can be completed only by a user with Read + Write + Delete access
to the folder in which the object is pasted. For more details, see Copying and Moving on page52
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 resources is allowed only if no other resources rely on them. For more details, see Deleting
Folders and Resources on page54
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.
Using permissions, you can manage large hierarchies of content and keep them secure. When you set 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 assigned on an
organizations top folder are inherited across the entire organization. Permissions set on the root folder or
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.
58
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. So, 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 ReadOnly 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 (professional edition only), ROLE_
ADMINISTRATOR, or both. By design, system administrators with the ROLE_SUPERUSER always have
irrevocable Administer access to the entire repository, including 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 readonly 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 the 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, with a repository search.
As with all other permissions, execute-only permission is either role-based or user-based, so only certain users
can access a resource from a running report.
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.
59
3.5.5
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 set the permissions only on that specific
resource.
To set permissions on a folder or resource in the repository:
1. Log in as a user with administrative privileges.
2.
3.
Right-click the object and select Permissions... from the context menu:
The Permissions dialog opens showing 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
asterisks (*).
60
In the dialog, click User to view the permissions assigned to specific users. Click Role when viewing user
permissions to toggle back.
5.
For each user or role, you can select a new permission from the drop-down.
In the next figure, you can see the default user permissions on this folder. In the default installation, all
permissions are defined by role; so, 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 enables joeuser to see but not
modify the Input Data Types folder and its contents. For all other end users, but, the folder is still executeonly due to the settings in Figure 3-5.
61
Click Apply to apply your changes. If you toggle between user and role permissions, first apply any
changes you made.
7.
Click OK to save your changes and close the permissions dialog when you're finished.
You can open several permissions dialogs for different resources or folders at the same time while
navigating the repository. This helps when trying to set permissions uniformly across several folders or
organizations.
There are two special cases when setting permissions:
3.5.7
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 if 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.
62
2.
3.
4.
5.
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.
Verify that the expected folders and resources are available in the repository. Make a note of any objects
that should be there but are not, and any that should be hidden but are displayed.
7.
8.
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.
9.
10. Repeat these steps with several representative users to ensure that your access control is properly
configured. An untested access control configuration cant secure your data adequately.
63
64
CHAPTER 4
DATA SOURCES
A data source is a resource in the repository that specifies how and where to obtain the data displayed by
reports, Ad Hoc views, and OLAP views. Administrators must define data sources before uploading reports that
rely on them. Typically, a data source specifies the URI of the database server and the details you need to access
it, such as a user name and password.
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 data source types for relational databases, most flavors of big data, and for
specialized data such as Amazon Web Services and JavaBean data. Virtual data sources allow you to combine
several data sources into one.
JasperReports Server can access any relational database that supports the SQL query language through the JDBC
(Java DataBase Connectivity) API. 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. After
installation, JasperReports Server includes JDBC drivers to access the most popular databases: MySQL,
PostgreSQL, Oracle, SQL Server, and DB2. As of release 5.6.1, the server also includes a JDBC driver that
can access Hadoop-Hive. If the driver for your database is not installed, or you want to use alternate drivers,
the system admin can upload and manage JDBC drivers through the UI. With JDBC data sources,
JasperReports Server configures and manages the connections to the database. By default, the maximum
number of simultaneous connections for each data source is 20.
JNDI data source Relies on the JNDI (Java Naming and Directory Interface) service of your application
server to access a database connection. You must first configure your application server to install its JDBC
drivers and configure its database connections. The configuration of the application server determines the
number of shared connections. Note that the application server connects to the database using JDBC,
meaning that JNDI data sources are available for all databases that support JDBC.
Big data stores that are not compatible with JDBC have custom data sources:
Cassandra This new data source introduced in JasperReports Server 5.6 is different from the communitycontributed data source for Cassandra. This data source supports the Cassandra Query Language CQL 3.
Cloudera 5 This data source can access Apache Hadoop clusters through Cloudera 5 Hive or Impala. It
uses the Hive Query Language (HiveQL), which is similar to SQL but distinct. All other Hadoop-Hive data
sources should use the JDBC driver described above.
MongoDB This custom data source for MongoDB supports Jaspersoft's own MongoDB Query Language.
65
Amazon Web Services (AWS) data sources Accesses data stored in your AWS data store using
JasperReports Server, either on-premises or in the cloud.
Virtual data source Allows you to combine multiple data sources into a single data source and join them
within a Domain. You can also wrap a data source for big data to be used in a Domain.
Bean data source Allows you to access data encapsulated in JavaBeans.
Internal diagnostic data source A custom data source for the servers own diagnostic data. The diagnostic
information is available only to system admins (superuser by default). For more information, see Using
the Diagnostic Data in Reports on page244.
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
Attributes can be used to derive all data source parameters that are not selected from drop down lists.
When defining a data source attribute, you can either specify the category in which the server should look for
its value, or allow the server to locate the value hierarchically.
4.1.1
66
User
Tenant (organization)
Server
4.1.2
{attribute('host','User')} - Host will be derived categorically from the logged-in user's attributes,
67
{attribute('password')} - The password field can also reference an attribute, here a hierarchical
attribute.
For information about user attributes, see 2.2.4, Editing User Attributes, on page35
For information about defining organization and server attributes, see 2.1.5, Creating Attributes on
Organizations, on page29
4.2
Click View > Repository, right-click a folder's name, and select Add Resource > Data Source from the
context menu. Alternatively, you can select Create > Data Source from the main menu on any page and
specify a folder location later. If you installed the sample data, the suggested folder is DataSources. The
New Data Source page appears.
3.
In the Type field, select JDBC Data Source. The page refreshes to show the fields required for a JDBC
data source.
4.
Select the JDBC driver for your database. If your driver is listed as NOT INSTALLED, a system
administrator must first upload the driver as described in Managing JDBC Drivers on page70.
5.
Enter the hostname, port, and database name for your database. The default hostname is localhost, and the
default port is the typical port for the specified database vendor. The three fields are combined
automatically to create the JDBC URL where the server will access the database.
For more information about JDBC URLs, including optional parameters, see the troubleshooting section
JDBC Database URLs on page258.
You have the option to use profile attributes to derive the values for data source parameters. See
Attributes in Data Source Definitions on page66
As of JasperReports Server 5.6.1, TIBCO provides a set of JDBC drivers in the installed server.
These drivers support a slightly different SQL syntax. If you see errors when running reports or
creating domains that use scalar functions, see A.13.6, SQL Functions with TIBCO JDBC
Drivers, on page258.
68
Fill in the database user name and password. These are the credentials the server will use to access the
database.
Set the Time Zone field when the date-time values stored in your database do not indicate a time
zone. When date-time 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 properly convert
date-time values read from the target database. Set the Time Zone field to the correct time zone for
the data in the database. The list of time zones is configurable, as described in Specifying
Additional Time Zones on page278.
When in doubt, leave the Time Zone field blank.
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. To diagnose JDBC connection issues, you can turn on
logging as described in the troubleshooting section Logging JDBC Operations on page256.
69
When the test is successful, click Save. The Save dialog appears.
Enter the data source name and, optionally, a description. the Resource ID appears based on the name you
enter.
10. Expand the folder tree and select the location for your data source, then click Save. The data source
appears in the repository.
4.3
70
MySQL (org.mariadb.jdbc.Driver)
PostgreSQL (org.postgresql.Driver)
Oracle (tibcosoftware.jdbc.oracle.OracleDriver)
Microsoft SQL Server (tibcosoftware.jdbc.sqlserver.SQLServerDriver)
IBM DB2 (tibcosoftware.jdbc.db2.DB2Driver)
Hive (tibcosoftware.jdbc.hive.HiveDriver)
Drivers for other databases can be downloaded from links on the Jaspersoft community website:
http://community.jaspersoft.com/wiki/downloading-and-installing-database-drivers
The system administrator (superuser) can add JDBC drivers for other databases in the following ways:
During installation. For more information, see the JasperReports Server Installation Guide.
At any time through the UI. As described in the procedure below, the system admin can add, replace, or
remove JDBC drivers through the user interface, without needing to restart the server.
Only the system administrator can manage the JDBC drivers, but once uploaded, they're available to all
administrators who create data sources.
JBoss doesn't lacks the flexibility of uploading drivers on the fly. On JBoss, drivers that are not installed
don't appear in the list below, and you must configure and restart JBoss to add a driver. For more
information, see JDBC Drivers on JBoss on page257.
3.
In the Type field, select JDBC Data Source. The page refreshes to show the fields necessary for a JDBC
data source.
4.
The dropdown selector for the JDBC Driver field shows the available JDBC drivers and those that are not
installed.
If you want to add a driver that has not been installed, select it from the list, then click Add Driver. The
Select Driver dialog appears.
6.
If you have not yet obtained the driver, click the link for Downloading and Installing Database Drivers.
That page on Jaspersoft's community website has links to the most commonly used JDBC drivers. After you
download a driver to your file system, you can return to the Select Driver dialog.
71
In the Select Driver dialog, click Browse to locate the appropriate driver JAR file. If your driver has more
than one JAR file, click the Browse button that appears after selecting the first file.
8.
You can replace any driver that you upload with newer versions of the same driver. If you want to use the
vendor's own driver instead of the TIBCO JDBC driver, you can install it as a new driver as described in the
JasperReports Server Installation Guide.
To update a JDBC driver:
1. Log on as the system administrator (superuser on commercial editions, jasperadmin on community
editions).
2.
3.
In the Type field, select JDBC Data Source. The page refreshes to show the fields necessary for a JDBC
data source.
4.
The dropdown selector for the JDBC Driver field shows the available JDBC drivers and those that are not
installed.
5.
To update a driver that has already been installed, select it from the list, then click Edit Driver. The Select
Driver dialog appears and notifies you that selecting a driver will overwrite the existing one.
72
6.
In the Select Driver dialog, click Browse to locate the new driver JAR file.
7.
8.
Click Upload to replace the existing driver and make it available immediately.
You can now use this driver to create a data source, and the driver will be installed when other
administrators create data sources.
Select View > Repository and open the System Properties folder at the root.
3.
4.
Right click the GlobalPropertiesList resource and select Edit from the context menu.
Locate the driver you uploaded in the list of properties. The drivers with the value [SYSTEM] are the
default drivers configured at installation time.
5.
4.4
For information about setting up a JNDI connection in your application server, see the following sections:
73
Click View > Repository, expand the folder tree, and right-click a folder to select Add Resource > Data
Source from the context menu. Alternatively, you can select Create > Data Source from the main menu
on any page and specify a folder location later. If you installed the sample data, the suggested folder is
DataSources. The New Data Source page appears.
3.
In the Type field, select JNDI Data Source. The information on the page changes to reflect whats needed
to define a JNDI data source.
You have the option to use profile attributes to derive the values for data source parameters. See
Attributes in Data Source Definitions on page66
4.
Fill in the service name. This is the name the application server exposes through JNDI.
74
5.
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 JNDI Services on Apache Tomcat on page259.
6.
When the test is successful, click Save. The Save dialog appears.
Enter the data source name and, optionally, a description. the Resource ID appears based on the name you
enter.
8.
Expand the folder tree and select the location for your data source, then click Save. The data source
appears in the repository.
For details about configuring and exposing a JNDI database connection at the application server level, refer to
the documentation provided with your application server.
4.5
JasperReports Server can access either of these services when you define a data source with the correct
configuration information and credentials. The AWS data source wizard uses the AWS credentials you provide
to discover RDS and Redshift data sources. Then it uses those credentials to properly configure security groups
to maintain the connection between JasperReports Server and the AWS data source, even when the IP address
changes. You can access AWS data sources from both stand-alone server instances that you maintain on your
own computers and virtual server instances that you run on Amazons Elastic Compute Cloud (EC2). For more
information, see https://www.jaspersoft.com/cloud.
To create an AWS Data Source:
1. Log into JasperReports Server as an administrator.
75
2.
Click View > Repository, expand the folder tree, and right-click a folder to select Add Resource > Data
Source from the context menu. Alternatively, you can select Create > Data Source from the main menu
on any page and specify a folder location later. If you installed the sample data, the suggested folder is
DataSources. The New Data Source page appears.
3.
In the Type field, select AWS Data Source. The information on the page changes to reflect whats needed
to define an AWS data source.
Under AWS Settings, specify your Amazon credentials in one of the following ways:
76
If your JasperReports Server is running in Amazons EC2 service, and it has the proper instance role
assigned, the server will detect this and automatically use your EC2 credentials. Using the EC2
instance credentials requires that the role was properly set up and assigned when the instance was
created. If you're using the EC2 service, we strongly recommend that you use the EC2 credentials.
If your JasperReports Server is not running on Amazons EC2, enter the AWS credentials associated
with the RDS or Redshift service. If you dont have AWS keys, click Generate credentials, then look
for them on the Outputs tab for your Stack on the Amazon console:
Under Select an AWS Data Source, specify the connection details of the AWS data source that you want to
connect to:
a.
b.
c.
d.
77
6.
4.6
The current version of Cassandra does not support NULL values in the data. All required fields must have
non-NULL default values. This also means that input controls cannot be null and must be given a value.
The current version of the driver does not support aggregate functions (sum, min, max).
For query parameters, the current version of the driver supports $X(IN...), but no other $X functions.
As the Cassandra driver is updated to include more functionality, we plan to update the Cassadra data source in
future releases.
The Cassandra data source supports queries in the Cassandra Query Language 3 (CQL3). To improve
performance, design your Cassandra data using the following guidelines:
As with all big data stores, Cassandra data sources have the following limitations and usage guidelines within
JasperReports Server:
4.6.1
78
1.
Log on as an administrator.
2.
Click View > Repository, expand the folder tree, and right-click a folder to select Add Resource > Data
Source from the context menu. Alternatively, you can select Create > Data Source from the main menu
on any page and specify a folder location later. If you installed the sample data, the suggested folder is
DataSources. The New Data Source page appears.
3.
In the Type field, select Cassandra Data Source. The information on the page changes to reflect whats
needed to define a Cassandra data source.
You have the option to use profile attributes to derive the values for data source parameters. See
Attributes in Data Source Definitions on page66
Fill in the required fields, along with any optional information you choose.
Use port 9042 with the Cassandra data source. Cassandra's default port of 9160 is for the Thrift client that is
commonly used with Cassandra. To use the Cassandra Query Language (CQL) with our Cassandra data
source, you may need to configure your Cassandra instance as follows:
start_native_transport: true
native_transport_port: 9042
5.
If you have configured your Cassandra source to be password protected, specify a valid username and
password. Due to compatibility issues, Cassandra authentication is supported only when you use Cassandra
1.12.18 and above.
6.
Click Test Connection to check the values you entered. Make sure that the port is set to 9042, because
the connection test will also work with the wrong port (9160).
7.
79
Enter the data source name and, optionally, a description. the Resource ID appears based on the name you
enter.
9.
Expand the folder tree and select the location for your data source, then click Save. The data source
appears in the repository.
4.6.2
or
sudo ulimit -Sn 32768
The effects of the commands above will be reset when the computer restarts. To make the changes permanent,
edit the file /etc/security/limits.conf to add the following settings:
* soft nofile 32768
* hard nofile 32768
root soft nofile 32768
root hard nofile 32768
* soft memlock unlimited
* hard memlock unlimited
80
4.7
CDH 5 Hive-Impala Data Source - If you access Hadoop-Hive2 or Hadoop-Impala through a Cloudera 5
server only.
JDBC Data Source with Hive JDBC driver - Most other Hive 1, Hive 2 and Impala servers.
Depending on whether you use Hive 1, Hive 2, or Impala, there are certain restrictions on accessing data in
Hadoop.
CDH 5 Hive-Impala data sources have very low latency, and allow interactivity with Ad Hoc views, filters, and
dashboards. However, Hadoop-Impala data sources still have the following limitations:
CDH 5 Hive-Impala data sources are not supported for OLAP connections.
CDH 5 Hive-Impala data sources cannot be used directly in Domains. To use Hadoop-Impala in a Domain,
see Big Data Connectors for Virtual Data Sources on page90.
CDH 5 Hive-Impala data sources can be used in Ad Hoc Topics, but they do not support query
optimization.
You must configure your query limits to handle big data (see Ad Hoc Data Policies for Big Data on
page185).
You must configure your JVM memory to handle the expected amount of data (see the JasperReports
Server Installation Guide).
The JDBC driver for Hive works with most other Hive 1, Hive 2, and Impala servers, and it can be used with
Domains. However, the original Hive 1 server has high latency with access times on the order of 30 seconds
and up to 2 minutes. Hive 2 is much faster, but still not as fast as relational databases. 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 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 Ad Hoc Data Policies for Big
Data on page185).
You must configure your JVM memory to handle the expected amount of data (see the JasperReports
Server Installation Guide).
In general, reports based on JDBC-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 when you
need it during the day.
To create a Hive JDBC data source, follow the same procedure as in JDBC Data Sources on page68.
To create a CDH 5 Hive-Impala data source:
1. Log on as an administrator.
81
2.
Click View > Repository, expand the folder tree, and right-click a folder to select Add Resource > Data
Source from the context menu. Alternatively, you can select Create > Data Source from the main menu
on any page and specify a folder location later. If you have installed the sample data, the suggested folder is
DataSources. The New Data Source page appears.
3.
In the Type field, select Impala Data Source. The information on the page changes to reflect whats
needed to define a Hadoop-Hive data source.
You have the option to use profile attributes to derive the values for data source parameters. See
Attributes in Data Source Definitions on page66
Fill in the required fields, along with any optional information you choose.
The JDBC URL depends on which type of server you are using:
82
Hive 2:
jdbc:hive2://<hostname>:10001/default
Impala:
jdbc:hive2://<hostname>:21050/;auth=noSasl
5.
6.
When the test is successful, click Save. The Save dialog appears.
4.8
7.
Enter the data source name and, optionally, a description. the Resource ID appears based on the name you
enter.
8.
Expand the folder tree and select the location for your data source, then click Save. The data source
appears in the repository.
83
2.
Click View > Repository, expand the folder tree, and right-click a folder to select Add Resource > Data
Source from the context menu. Alternatively, you can select Create > Data Source from the main menu
on any page and specify a folder location later. If you have installed the sample data, the suggested folder is
DataSources. The New Data Source page appears.
3.
In the Type field, select MongoDB Data Source. The information on the page changes to reflect whats
needed to define a MongoDB data source.
You have the option to use profile attributes to derive the values for data source parameters. See
Attributes in Data Source Definitions on page66
84
5.
The schema is used only if you plan to wrap the MongoDB data source in a virtual data source for use in a
Domain. For instructions, see Relational Schema for MongoDB Connector on page91.
6.
7.
When the test is successful, click Save. The Save dialog appears.
Enter the data source name and, optionally, a description. the Resource ID appears based on the name you
enter.
9.
Expand the folder tree and select the location for your data source, then click Save. The data source
appears in the repository.
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}
}
85
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 the Community website.
4.9
They allow you to combine multiple JDBC and JNDI data sources and make them available to be joined
through a Domain. You can combine any number of data sources, including schemas from different
databases, databases from different vendors, and different schemas within the same database into a single
object.
They make Cassandra, Hadoop-Hive, and MongoDB data sources available in Domains. In this case, the
virtual data source acts as a wrapper for the data source for big data, with certain limitations described in
Big Data Connectors for Virtual Data Sources on page90.
A virtual data source can wrap a single data source for big data, or combine any number of JDBC, JNDI and big
data data sources.
Once you have created a virtual data source, you create a Domain that joins tables across the data sources to
define the relationships among the data. Ad Hoc views and reports based on the Domain can access the
combined data transparently. For more information about Domains, see the chapter "Creating Domains" in the
JasperReports Server User Guide.
86
Click View > Repository, expand the folder tree, and right-click a folder to select Add Resource > Data
Source from the context menu. Alternatively, you can select Create > Data Source from the main menu
on any page and specify a folder location later. If you have installed the sample data, the suggested folder is
DataSources. The New Data Source page appears.
3.
4.
87
5.
Change the aliases by editing them directly in the Alias column (optional). The alias identifies 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 in aliases.
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.
6.
88
Enter the data source name and, optionally, a description. the Resource ID appears based on the name you
enter.
8.
Expand the folder tree and select the location for your data source, then click Save. The data source
appears 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. Log on as an administrator.
4.9.1
2.
Click View > Repository and expand the folder tree to locate the folder containing the data source.
3.
4.
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.
5.
Click Save. If you try to delete a data source from a virtual data source that is used by a Domain, you'll
receive a warning and the data source will remain unchanged. Otherwise, the data source is updated in the
repository.
Performance Considerations
Virtual data sources are based on the Teiid engine to handle multiple data sources and combine the results from
them. How you design the tables in each of your data sources and how you combine them in a Domain join can
significantly affect performance.
Consider these issues when designing a solution that combines several databases in a virtual data source:
89
When using virtual data source in a Domain, you must select at least of the tables from the Tables tab to
appear in the Domain before using it to create a derived table. Virtual data sources are optimized to use the
smallest set of metadata, but they do detect Domains that use only derived tables.
The virtual data source runs in JasperReports Server and must allocate memory and use processing to handle
result sets.
The Teiid engine uses its own cache for data accessed through a virtual data source. You can clear the Teiid
cache at the same time as the Ad Hoc cache, as described in Ad Hoc Cache Management on page188.
The virtual data source can push down certain operations (joins, filters, and aggregations) to the databases,
others it must perform in memory. The more it can push down, the smaller the datasets it handles in memory
You should design your schema to maximize the processing pushed to the database and minimize data
handled in the virtual data source in a join between data sources.
For example, if you create a duplicate copy of a date dimension table in both of your data sources, they can be
joined much more efficiently. If this table existed in only one database, the Teiid engine would need to retrieve
all the rows from the other database and perform the join itself. With this table in both data bases, the Teiid
engine can push down all of the time-dimension joins to the individual databases and perform a final join on
much smaller datasets.
For more information about optimizing your data for use in Teiid, see http://www.jboss.org/teiid/.
4.9.2
Cassandra
Hadoop-Hive 1, 2, and Impala
MongoDB
Virtual data sources use the Teiid query engine internally to join the data from various sources, and to access
big data stores. In the case of big data, the virtual data source extracts the connection information from the
existing data source and uses an internal Teiid connector to access data. The Teiid connectors map the various
structures used in each big data model to a relational model with tables and fields. This connector is distinct
from what are called the native data sources for big data. For this reason, when a data source for big data is
wrapped in a virtual data source, the resulting data source has the following limitations:
90
The Cassandra, Hadoop, and MongoDB connectors in virtual data sources do not support query parameters
($P and $X). Therefore, if you use a big data connector wrapped in a virtual data source as the data source
for a stand-alone query, report or Topic, you can't include parameters to create input controls. When used in
Domains and then Ad Hoc views, you can define filters to replace this functionality.
The Cassandra connector for virtual data sources does not support any aggregation functions.
The MongoDB connector for virtual data sources does not support the find operations, aggregation or map
reduce functions that the native MongoDB data source allows.
The MongoDB connector for virtual data sources can't be used in stand-alone reports or Topics. It must be
used in a Domain and accessed through an Ad Hoc view or report.
However, there are significant advantages to accessing big data through virtual data sources:
When wrapped in a virtual data source, you can access Cassandra, Hadoop, and MongoDB through a
Domain, Domain Topic, Ad Hoc view, and Ad Hoc report.
A virtual data source can contain any mix of JDBC, JNDI, and big data connectors. When you define a
Domain using this data source, you can access the tables from each store and define joins between
compatible fields.
Virtual data sources that use a big data connector support query optimization, unlike the native data sources
for big data. In fact, the big data connectors for virtual data sources support query optimization in Ad Hoc
views and reports based on stand-alone Topics, and in Ad Ho views and reports based on Domains. The
only exceptions are calculated fields, which cannot be optimized when used in Ad Hoc views or reports
that are based on Topics or Domains. For more information about query optimization, see 9.4.3, Ad Hoc
Data Policies for Big Data, on page185.
4.10.1
To create a virtual data source that accesses a data source for big data:
1. Create a native data source for big data, or verify that it was created as described in one of the following
sections:
2.
3.
In the virtual data source creation dialog, select the big data source that you created in the first step, and
save the virtual data source. You can select one or more big data sources, or any mix of big data, JDBC,
and JNDI data sources.
4.
Create a Domain, specify the virtual data source you just created, and then select the big data tables when
you create the Domain schema. The data from the data source is mapped to tables and fields in the Domain
that you can use to create joins, filters, and all other features of a Domain.
4.10.2
This schema defines a relational structure of tables and columns for the data in your MongoDB instance. The
following URLgives the syntax for the schema text:
https://docs.jboss.org/author/display/TEIID/MongoDB+Translator
The following example shows a document from the collection named customer in MongoDB with an
embedded document named address. The right side shows the corresponding schema for use in the virtual data
source connector.
91
{
"_id": 10,
"name": "John Doe",
"age": 27,
"gender": "male",
"address": {
"_id": 10,
"street": "123 Sesame St.",
"city": "Anytown",
"state": "Rhode Island",
"zip": 12345
}
}
For embedded relations in MongoDB (both 1-to-1 and 1-to-many), the embedded document must have the
same ID as the parent document.
The MongoDB translator supports automatic mapping of Teiid data types into MongoDB data types.
Not all MongoDB data types are supported. Currently, the following types are not supported:
MongoDB Arrays
MongoDB::OID
Regular Expressions
MongoDB::Code
MongoDB::MinKey and MongoDB::MaxKey
As a result, your documents should use integer IDs and not MongoDB::OID.
When you change the mapping or add a new collection in the schema, you must restart JasperReports
Server.
92
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 create a bean data source:
1. Log on as an administrator.
2.
Click View > Repository, expand the folder tree, and right-click a folder to select Add Resource > Data
Source from the context menu. Alternatively, you can select Create > Data Source from the main menu
on any page and specify a folder location later. If you installed the sample data, the suggested folder is
DataSources. The New Data Source page appears, as shown in the figure below.
3.
In the Type field, select Bean Data Source. The information on the page changes to reflect whats needed
to define a bean data source.
4.
Enter the bean name. 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.
Click Test Connection to validate the data source. If the validation fails, ensure that the values you
entered are correct and that the bean is in the classpath.
6.
When the test is successful, click Save. The Save dialog appears.
93
94
7.
Enter the data source name and, optionally, a description. the Resource ID appears based on the name you
enter.
8.
Expand the folder tree and select the location for your data source, then click Save. The data source
appears in the repository.
CHAPTER 5
The previous chapter introduced data sources necessary to create any report. But the repository also stores other
resources needed by reports. This chapter goes into detail about how to create queries, input controls, and file
resources. These are the resources that users reference when uploading a JRXML file to create a JasperReport.
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 us.
As an administrator, you need to define the resources required for your users' reports. If you have users who are
proficient at creating their own reports in Jaspersoft Studio they can upload them as JasperReports to the server.
In this case, you'll work with them to prepare the resources required by their reports. For less proficient users,
you'll have to create and upload their JasperReports to the server.
This chapter contains the following sections:
5.1
Queries
Datatypes
Lists of Values
Input Controls
Query-based Input Controls
Cascading Input Controls
File Resources
Queries
A JRXML report uses a query to select the data to be returned from the data source. You can define the query in
the JRXML itself,, but you can also create and save queries in the repository. A query saved 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. 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.
95
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 guide.
You can also use queries to populate list input controls, as described in Query-based Input Controls on
page102 and Cascading Input Controls on page109.
To create a reusable query:
1. Login as an administrator.
2.
Click View > Repository and locate the folder for the query. If you installed the sample data, the
suggested folder is Input Data Types.
3.
Right click the folder's name and select Add Resource > Query from the context menu. The Add Query
page appears.
Enter a name for the query. Resource ID is filled in automatically, and the description is optional Click
Next. The Link a Data Source page appears.
96
5.
Select the data source and click Next. Your options are:
Do not link a data source. If no data source is associated with the query, the server uses the data
source associated with the report that references the query.
Create a new data source. You can define a local data source within this query resource that's not
accessible to any other resource. This new data source overrides any data source specified in reports
that use the 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 the query.
Click Next. the Define the Query page appears.
7.
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 additional query languages if a query executor implementation is properlyconfigured for each additional language when the server is deployed.
You can use a specialized bean data source to support multiple query languages. For information about bean
data sources, refer to Bean Data Sources on page92. Another option to add new types of data sources to the
server to extend the reach of the JasperReports Server platform.. Custom data sources are described in the
JasperReports Server Ultimate Guide.
97
5.2
Datatypes
A datatype defines the format of a single-value input control, for example text or numerical. Datatypes
determine what users can enter in the input fields that correspond to parameters in a report:
Text
Number
Date
Date/time
To create a datatype:
1. Log on as an administrator.
2.
Click View > Repositoryand locate the folder for the datatype. If you installed the sample data, the
suggested folder is Input Data Types.
3.
Right click the folder's name's name and select Add Resource > Datatype from the context menu. The
Add Datatype page appears.
Enter a name and optional description for the datatype. The resource ID is filled in automatically.
5.
Select the datatype and provide related information. Your options are:
98
Text You can specify a regular expression in the Pattern field. The expression is used to validate the
text 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 you select a Strict check box, 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.
6.
5.3
Date and Date/Time Click the calendar icon to the right of the Minimum and Maximum date/date
time fields to choose their values.
Click Save. The datatype resource appears in the repository.
Lists of Values
A lists of values resource is a static list of values for single-select or multi-select input controls. Depending on
the type of input control, the user selects one or more of these labels using radio buttons, check boxes, or dropdown lists.
To create a list of values:
1. Log on as an administrator.
2.
Click View > Repository and locate the folder for the new list of values. If you installed the sample data,
the suggested folder is Input Data Types.
3.
Right click the folder's name and select Add Resource > List of Values from the context menu. The Add
List of Values page appears.
5.4
4.
Enter a name for the list of values. Resource ID is filled in automatically, and the description is optional
5.
Enter the name and value for each item in the list and click Add.
The name and value are both treated as strings. Users see the label only in an input control that uses the
list, and the report receives only the value. To remove an item, click Remove beside the value.
6.
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).
99
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:
When a user runs the report, the server uses this information to prompt the user for a value and to validate that
input. For example, consider a report that returns sales data for all of a companys products; the user might input
a product to view by selecting a product name in a list.
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 Presented 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 .TRUE or FALSE as values,
depending on whether the box is checked.
Single value Presented 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 Presented either as a drop-down list or a set of radio buttons. A single-select input control
returns a single value.
Multi-select Presented as a scrollable list of values 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 Local Resources and External References on page47.
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, see the JasperReports Server User
Guide.
Some input controls rely on queries to populate their options. These more complex controls are
described in Query-based Input Controls on page102.
As with other resources, input controls can be created locally as part of a JasperReport, in which case they
cannot be seen outside that 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:
100
The parameter name in the input control must correspond to the name of the parameter in the report. No
error occurs for a mismatch, but at runtime NULL is passed instead of actual value of the parameter.
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 in the repository. To reference input controls in a
JasperReport, see the JasperReports Server User Guide.
To create an input control:
1. Log on as an administrator.
2.
Click View > Repository and locate the folder for the input control. If you installed the sample data, the
suggested folder is Input Data Types.
3.
Right click the folder's name and select Add Resource > Input Control from the context menu. The Add
Input Control page appears.
Select the type of input control from the Type list. In this example, Single Value is selected.
Enter the prompt to tell users how to use the control. This example, uses the prompt Select the text
for the report title.
6.
In practice, the prompt text is often the same as the parameter, so the parameter name is automatically filled
in. If you have used a different prompt, edit the Parameter Name field and enter the exact name of the
parameter for your control. Remember, the parameter name must be the same here as in the reports that use
this input control.
For this example, the parameter name is title. Description is optional.
7.
8.
101
9.
5.5
5.5.1
102
1.
Log in as an administrator.
2.
Browse the repository and select the folder for the query-based input control.
3.
Right click the folder's name and select Add Resource > Input Control. The Add Input Control dialog
appears:
Select the type of query-based input control from the type drop-down list. This 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 type.
5.
Specify the prompt text, parameter name, optional description, and appearance options in the same manner
as when defining a regular input control.
6.
Click Next. Because we selected one of the query-based types, the Locate Query page appears:
Click Next to define the local query resource. The query naming dialog appears:
103
Enter any name, and the ID is filled in automatically. Then click Next. The link data source page appears:
104
First, specify the value column. This 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.
105
b.
Next, specify the visible columns. These are the fields whose values appear in the input control the user
chooses from. In the simplest case, enter the same field as the value column. If you add multiple fields
to the visible columns, the input control displays the fields together, in the order listed, separated by a
vertical bar (|). In this example, the user can 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 fields 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.
5.5.2
Type
Notes
LoggedInUser
User
LoggedInUsername
String
LoggedInUserFullName
String
LoggedInUserEmail
Address
String
LoggedInUserEnabled
Boolean
LoggedInUserExternally
Defined
Boolean
LoggedInUserTenantId
String
LoggedInUserRoles
Collection
<String>
Attributes defined on users, organizations, or at the server-level can also be used in reports and query-based
input controls. For more information, see:
106
Type
Notes
LoggedInUserAttributes
Map<String,
String>
LoggedInUserAttribute
Names
Collection
<String>
LoggedInUserAttribute
Values
Collection
<String>
LoggedInUserAttribute_
<attribute-name>
String
LoggedInTenantAttribute_
<attribute-name>
String
ServerAttribute_
<attribute-name>
String
107
Parameter Name
Type
Notes
Attribute_
<attribute-name>
String
5.5.3
Domain-based Queries
For reports that use a Domain as the data source (professional edition only), a query-based input control must
contain a query against the Domain. When defining the query as shown in Figure 5-12 on page 105, 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's used only for backward compatibility and should not be selected for new
Domain-based queries.
Domain queries have their own special syntax, the same one that's 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 of 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 Domainbased 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" />
108
Then, when specifying your visible query columns, as shown in Cascading Input Controls on page109,
you'd 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
USA
USA
USA
|
|
|
|
CA | Los Angeles
CA | San Francisco
OR | Portland
WA | Redmond
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.
5.6
109
example can have two input controls, one for the state and one for the city: The city input control is empty
until the user selects a state.
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 in
that state. When the user selects one and submits it, the city name is passed as a parameter to the report.
For an especially large number of cities, you can use more cascading input controls, such as region of state, to
reduce the list.
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.
5.6.1
$P{parameter_name}
The value of the parameter is substituted into the query. In cases where the parameter contains a string, the
substitution inserts the proper escape characters to create valid SQL. Use this for single-select input controls
and simple comparison operators such as greater-than or less-than. For example:
select name from EMPLOYEES where deals_closed > $P{DEALS}
Do not use $P{parameter_name} with equality because the parameter value can be null, and field = NULL
is not valid SQL. Instead use $X{EQUALS, ...} as explained below.
$P!{parameter_name}
The value of the parameter is treated as raw text. The server replaces the parameter with the value of the
input control without performing extra checking or value escaping. This is used in complex cases where the
input control provides a piece of the query or sometimes the entire query.
This syntax performs equality verification and handles the case when the parameter value is null. Use this
everywhere instead of the old column = $P{parameter_name} syntax. The $X{EQUALS...} syntax
performs the following substitution before submitting the query:
column = parameter_value -- when parameter_value is non-null
column IS NULL -- when parameter_value is NULL
Use this parameter for cascading with multiple-select input controls. The $X{IN...} operator is true when the
field value matches any one of the multiple values of the input control. 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. The
query-based input control would have the following query:
select city from ACCOUNTS where $X{IN, country, COUNTRIES}
If 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')
110
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.
The $X syntax also supports the following operators. They are all designed to handle null input by generating 0
= 0 when the parameter value is null:
Parameter Syntax
Meaning
For more information on using $P, $P! and $X to build dynamic queries, see the JasperReports Ultimate Guide
and the Jaspersoft Studio User Guide.
Any number of parameters can be used in a query, just as any number of input controls can be defined in a
JasperReport. In addition to the standard input control parameters, a cascading input control query can use the
built-in parameters described in Built-in Parameters for Query-based Input Controls on page106.
5.6.2
111
We'll start with a report containing the following dataset fields: ORDERED, CUSTOMERID, EMPLOYEEID,
SHIPCITY, and SHIPCOUNTRY.
Our sample report is based on the following query that requires the user to enter a city:
select * from orders where SHIPCITY=$P{City}
3.
Enter Country for the Name of the input control and click Next.
4.
5.
Click the ellipsis button next to the Local Resource field. The Query window opens.
6.
112
8.
Click the Data Source from Repository option, select your data source, then click Finish.
9.
On the Value and Visible Columns tab, enter SHIPCOUNTRY in the Value Column field and click Add.
This is the column whose value is returned as the value of the Country input control.
10. Under Visible Query Columns, enter SHIPCOUNTRY. This is the column whose values populate the list
of cities the user can choose from.. In our case it is the same as the value column.
11. Click Finish.
Define an SQL query that uses the value of Country to derive valid values for City.
113
Select distinct SHIPCITY from orders where SHIPCOUNTRY = $P{Country} order by SHIPCITY
4.
Click the Data Source from the Repository option, select your data source, then click Finish.
5.
On the Value and Visible Columns tab, enter SHIPCITY in the Value Column field and click Add. This is
the column whose value is returned as the value of the City input control.
6.
Under Visible Query Columns, enter SHIPCITY, This is the column value used to create the list of cities
the user can choose from..
7.
Click Finish.
114
Now when you run your report in JasperReports Server, You'll see an input control for country and another for
city. After you select the country, the values available for city are those within that country. Notice that the
Country value is not passed to the report. It is used only to help the user select a city.
5.7
File Resources
You create file resources by uploading files so they can be referenced by Jasper Reports. JasperReports Server
supports the following file types:
Table 5-3 File Resource Types
File Type
Description
CSS
Cascading Style Sheet file that helps define the user interface as part of a theme.
Font
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 Fonts on page116).
Image
Any image format supported by the JVM (Java Virtual Machine), such as JPEG,
GIF, and PNG. Image files can be referenced in JasperReports, and also in CSS
files.
115
File Type
Description
JAR
Libraries that provide functionality for your reports (see JAR Files on page116)
JRXML
OLAP Schema
Defines the data in an OLAP cube, including how to aggregate the dimensions.
Resource Bundle
A Java .properties file containing key-value pairs for localization of reports (see
Resource Bundles on page116)
Style Template
A JRTX file containing a style template that can be shared among JasperReports.
XML
The way in which fonts, JAR files and resource bundles are associated with reports is further explained in the
following sections.
5.7.1
Fonts
The server relies on the JasperReports Library as its content rendering engine, which enables it to produce highquality, pixel-perfect documents. The server can use any of the fonts 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.
5.7.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's 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.
5.7.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.
116
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.
5.7.4
In the Folders panel, right-click the parent folder's name and select Add Resource > File from the context
menu , and select a resource type. In this example, 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. Click Browse to locate a file on your file system.
The figure below shows the dialog for adding a Font file. All file resources are created by uploading a file
in this way.
5.7.5
When done, click Submit. The new file resource appears in the selected folder in the Repository panel.
117
3.
Right-click the resource and select Edit from the context menu. In this example, we edit the font resource
created in Creating a File Resource on page117.
118
4.
Use the Edit dialog to view or modify the resource definition and its values. In the figure above, you can
see 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.
5.
CHAPTER 6
THEMES
A theme is the set of all CSS (Cascading Style Sheets) and associated images that define the appearance of the
user interface. Themes are stored in the Themes folder 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
switch among them, to change the UI's appearance.
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 us.
For multi-organization deployments, administrators can set the theme individually for each organization, or rely
on theme inheritance to use the same theme everywhere without needing to set it explicitly. Theme inheritance
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.
Themes were introduced in JasperReports Server 4.0, and the set of files in the default theme was
updated in 4.7. Custom themes developed before 4.7 may require upgrading to work with the new set of
files. For more information see the upgrade procedures in the JasperReports Server Installation Guide.
6.1
Introduction to Themes
How Themes Work
Administering Themes
Creating Themes
Working With CSS Files
Introduction to Themes
The default appearance of the JasperReports Server user interface (UI) can easily be modified to suit your needs.
The UI's appearance is based on CSS (Cascading Style Sheets). A theme is a collection of CSS files and
associated images that specify the appearance for all or part of the UI. A theme controls only the UI's looks-fonts, colors, lines, spacing, and images. It has no effect on content or functionality.
Themes are defined globally at the repository root and individually for each organization. Only administrators
can set the theme. Administrators can add, upload, edit, copy, and delete the files that make up the theme, just
119
like other resources in the repository. The repository allows 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.
Themes are 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 themes:
Scenario
Description
You can specify overrides of individual CSS rules or replace images in the
system theme. It's easy to create or upload the new files and activate
customizations. Your new theme is uploaded in real time and inheritance
ensures that every organization sees it at once.
6.2
For SaaS vendors, each organization can be a different client that needs a
special interface. Themes allow each organization to fully define the UI
and still retain override and inheritance for its own suborganizations. In
such deployments, each organization admin can modify or create the
appearance of his own user interface.
120
Chapter 6 Themes
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.
Name
Folder
Description
Default theme
System theme
The active theme set at the root level. All users in all organizations
see this theme unless an organization-specific themes activated.
Inherited theme
Organization >
Themes > default
Active theme
Organization >
Themes > activetheme
The theme that's 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.
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 and make the UI unusable. If this
happens you'll need to 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 indicating that it's the active theme.
121
6.2.1
Theme Files
A complete theme consists of the files listed for the default theme, as shown in the previous figure, 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 sectionUser Interface Samples on page133. 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 before 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 images associated with a theme include all the icons in the user interface and backgrounds for buttons and
borders. Several icons and backgrounds can be stored in the same file called a sprite. The theme also includes
the favicon.ico file that appears on browser tabs. There are approximately 60 image files in the default theme.
The default theme stores referenced image files in a folder named images. In a custom theme, there are two ways
to change an image of the default theme:
122
Use a folder named images and an image file with the same name as the one you want to replace.
Modify the corresponding CSS rules to redefine the location where the new image can be found.
Chapter 6 Themes
When you modify the CSS rules, you can use any of the following ways to reference image files, or any other
helper file:
6.2.2
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.
Inheritance
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, inheritance determines which file to load.
The server loads each of the CSS files listed in Figure 6-1. To locate the file, the server looks in the following
locations, in the orders listed below.
For professional edition users:
1.
2.
2.
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 inheritance.
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.
6.2.3
123
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 new files are inherited 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.
We recommend 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 file-based
inheritance. 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.
6.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 executeonly 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. To create theme folders and files, see
Creating Themes on page128. For information about how to work with CSS in themes, see Working With
CSS Files on page131.
124
Chapter 6 Themes
6.3.1
Log into JasperReports Server as system administrator (superuser in the professional edition;
jasperadmin in other editions).
2.
Click View > Repository and expand the Themes folder if necessary.
3.
Right-click the new theme folder and select Set as Active Theme.
For example, the sample data includes a two themes called jasper_dark and pods_summer that you can set
as active.
125
Figure 6-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.
6.3.2
126
Chapter 6 Themes
In a server licensed to use multiple organizations, specify the organization ID or alias on the login page.
2.
Click View > Repository and expand the Themes folder if necessary. The organizations Theme folder is
shown in the following figure.
Right-click the new theme folder name and select Set as Active Theme.
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.
6.3.3
1.
Log into JasperReports Server as system administrator (superuser for commercial editions, or
jasperadmin for community editions).
2.
Click View > Repository. Community edition users can skip to step 5.
127
3.
4.
Locate the name of the organization where you want to restrict access to themes and expand its folder.
5.
6.
6.4
7.
To restrict access to all organizations, repeat step4 to step6 for every organization in the server, including
suborganizations.
8.
If you want to restrict access in the same way in all future organizations, repeat step5 and step6 in the
Folder Template of every organization and suborganization in the server. Fore more information, see
Placing Themes in the Folder Template on page131.
Creating Themes
There are three ways to create the folders and files that make up a theme:
Creating Theme Folders and File Resources - Create them individually as resources in the repository.
Downloading and Uploading Theme ZIP Files - Copy and modify existing themes as ZIP (archive) files.
Placing Themes in the Folder Template - Initialize themes automatically in multi-organization
deployments.
This section explains only how to store CSS files in the repository. For information about creating CSS file
contents, see Working With CSS Files on page131.
128
Chapter 6 Themes
6.4.1
Click View > Repository and expand the folder tree to view the Themes folder where you want to place
the theme.
3.
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.
4.
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 shown in Figure
6-1.
5.
To add images to your theme, create any image folders and upload image files with Add Resource > File
> Image.
Repeat step4 and step5 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.
6.
7.
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.
6.4.2
Click View > Repository and expand the Themes folder if necessary.
129
3.
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.
4.
The server prompts you to save the file named <theme-name>.zip. Save it anywhere on your computer.
5.
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 CSS Priority
Scheme and Custom Overrides on page123 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. Place the CSS files, optional folders, and images files that constitute your theme in a folder on your
computer.
2.
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.
Log in as an administrator with access to the location where you want to upload the theme.
2.
Click View > Repository and expand the Themes folder if necessary.
3.
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.
130
Chapter 6 Themes
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 Creating Theme Folders and File Resources on page129. 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.
6.4.3
6.5
6.5.1
Reference
2. Create your new CSS rules, CSS files, and image files.
131
Step
Reference
6.5.2
6.5.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
132
Chapter 6 Themes
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.
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.
6.5.4
6.5.5
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).
133
2.
If you havent already done so, upload your theme to the Themes folder at this level. See Creating
Themes on page128.
3.
4.
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.
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.
134
CHAPTER 7
IMPORT
AND
EXPORT
The import and export tools enable you to move resources into and out of the JasperReports Server repository.
These 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.
JasperReports Server provides both a user interface and command-line utilities to perform import and export. The
functionality in the UI 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:
7.1
135
As of JasperReports Server 5.5, user passwords and data source passwords are encrypted in exported
catalogs as well as in the servers internal database. You should still take appropriate measures to
secure the catalog file from unauthorized access. Catalog files contain sensitive metadata such as user
names, database URLs, and internal or external organizations. Catalog files may also contain data in the
form of report output such as the PDF of an executive report.
7.1.1
Bean
Description
<property name="keyBytes">
<value>0x2b 0x6c 0x34 0x22
0x44 0x42 0x6f 0xb5 0x7f
0x34 0xd3 0x5a 0x1f 0x92
0xcd 0xdc</value>
</property>
importExport
Cipher
When you change a private key on a server, all previous exports become unusable. Therefore, you must
configure your new server soon after installing it, and you should configure it with the key from an existing
server, if you have one. This way all your servers and all your export catalogs will use the same key and
be mutually compatible.
7.1.2
136
7.2
When importing and exporting through the web interface, remember the following:
7.2.1
If you're importing to a different server, you must configure an encryption key on both servers, as described
in Setting the Import-Export Encryption Key on page136. You'll need to enter the keystore password
when prompted by the import operation.
Make sure the output location specified for an export is writable for the local user running the app server
containing JasperReports Server.
Select View > Repository. You can also export reports, Ad Hoc views, dashboards, and OLAP views from
the Library page.
Select one or more resources in the main panel, or when viewing the repository, select a folder in the leftpanel.
Right-click the selected folder or resources and select Export from the context menu. The Export Resources
dialog appears:
Name of the zip file for the exported catalog. The dialog supports only the zip archive format.
6.
7.
Include repository permissions Enabled by default. Clear this checkbox if you want the exported
items to inherit the permissions of the destination repository.
Include report jobs Select if you want to include scheduled report jobs with any reports included in
the selection.
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.
137
Resources are exported along with any dependencies, even if they're not located in the selected
folders. For more information, see Import and Export Catalogs on page135.
7.2.2
Select Manage > Server Settings, then click Export in the left-panel.
Specify the name of the zip file for the exported catalog. The web UI supports only the zip archive format.
4.
Use the cascading input controls to choose the contents of your exported catalog file:
a.
138
Select Export Everything (default) to export the entire repository, including permissions report jobs,
all organizations, users, and roles. Check the box for Include access events if you want to include
resource modification times.
b.
5.
6.
Clear Export Everything to select only users and roles to export. Then choose one of the User and
Role Selection options. You can directly select users and roles to export or select them indirectly. For
example, if you choose Export users with selected roles, you'll select users; and the server will
export them with their assigned roles.
b.
To select roles:
a.
b.
7.
To select users:
a.
b.
7.2.3
8.
In commercial editions of JasperReports Server, you can check Include audit events and Include
monitoring events as needed.
9.
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.
139
2.
Select Manage > Server Settings and choose Import in the left-hand panel.
Click Browse to choose the catalog zip file to import. The web UI supports only the zip archive format.
You can import any catalog zip file created by the export UI or the command-line export utility.
4.
Use the check boxes to change the behavior of the import operation:
5.
140
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.
In commercial editions of JasperReports Library, 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, AWS Settings, and OLAP Settings are affected. For more information, see Configuration
Settings in the User Interface on page176
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 and appear in the Settings UI.
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.
7.3
The import and export utilities are shell scripts located in the <js-install>/buildomatic folder:
Windows:
<js-install>\buildomatic\js-import.bat
<js-install>\buildomatic\js-export.bat
Linux:
<js-install>/buildomatic/js-import.sh
<js-install>/buildomatic/js-export.sh
The examples in this chapter use the shortened Windows commands without the optional .bat extension on the
command line. If you're running JasperReports Server in Linux, be sure to add the .sh file extension.
When using the import and export utilities, keep the following in mind:
7.3.1
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.
If you're importing to a different server, configure an encryption key on both servers, as described in Setting
the Import-Export Encryption Key. Then enter the keystore password when prompted by the import
command.
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're using a commercial edition of the server. In the community edition, paths dont include
organizations, for example:
Commercial editions:
/organizations/organization_1/reports/interactive/CustomersReport
Community project:
/reports/interactive/CustomersReport
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,and audit data. The export output is
known as a repository catalog. It's either an archive file or a set of files in a folder structure:
141
Explanation
--everything
Exports 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 also included.
This option is equivalent to:
--uris --repository-permissions --report-jobs --calendars --users --roles
--help
--include-access-events
--output-dir
--output-zip
--report-jobs
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 all subfolders.
--calendars
When specified, the export includes any and all calendars of all types (holiday,
recurring, ...) defined in the scheduler. When calendars are present in an export
catalog, they're always processed and added upon import.
--repository-permissions
This option exports repository permissions with each exported folder and
resource.
This option should only be used in conjunction with --uris.
--roles
Comma separated list of roles to export. If no roles are specified with this option,
all roles are exported.
--role-users
Use only with --roles. This option exports all users belonging to each exported
role.
--uris
--users
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
all roles assigned to each user. When specifying users, you must give their
organization ID if applicable, for example:
--users superuser, "jasperadmin|organization_1", ...
142
--include-audit-events
Includes audit data for all resources and users in the export.
--include-monitoringevents
Includes monitoring data for all resources and users in the export.
User passwords are encrypted during the export by default, but exported catalogs may contain
sensitive data. Take appropriate measures to secure the catalog file from unauthorized access.
Examples:
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 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.
7.3.2
143
As of JasperReports Server 5.5, all exports contain encrypted passwords and if you're importing to a different
server, configure an encryption key on both servers. See Setting the Import-Export Encryption Key for details.
Table 7-2 Options in js-import Command
Option
Explanation
--help
--input-dir
--input-zip
--update
Resources in the catalog replace those in the repository if their URIs and types
match.
--skip-user-update
When used with --update, users in the catalog are not imported or updated. Use
this option to import catalogs without overwriting currently defined users.
--include-access-events
--include-audit-events
--include-monitoringevents
--include-server-settings
Determines whether the system configuration is updated from the catalog. There
are two pre-requisites 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,
seeConfiguration Settings in the User Interface on page176.
The catalog must be exported with the everything option from the user
interface or the command-line utility.
This flag is required when importing a catalog that includes a theme, such as
when using --export-everything, from a server version 5.2 or before to version 5.5
or later. If you have a custom theme to import, you can use the Theme UI to
download it from the source server and upload it to the target server. If your theme
contains the file pageSpecific.css, you must remove it from the ZIP file before
uploading, and then redo your changes to the file based on pageSpecific.css in
the target server from 5.5 or later. For more information, see Downloading and
Uploading Theme ZIP Files on page129.
Examples:
144
Import the myDir catalog folder, replacing existing resources if their URIs and types match those found in
the catalog:
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
When a resource in the target repository has the same URIas on that you're importing, the default behavior is
leave the existing resource unchanged (no overwriting 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 a different type than the existing resource,
the server returns an error and skips the update operation.
When you import a user whose roles exist in the repository, the user is given those 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 has to be created with access events. If you don't import access events, or
if they dont exist in the imported files, the date and time of the import are used.
7.3.3
Depending on the database you use, copy the installation configuration file:
from:<js-install>/buildomatic/sample_conf/<database>_master.properties
to:<js-install>/buildomatic/default_master.properties
2.
Edit the default_master.properties file to set values specific to your installation. For more information about
the settings in this file, see the JasperReports Server Installation Guide.
Oracle users can set the sysUsername and sysPassword to the same name as dbUsername and
dbPassword in the default_master.properties. The system user name and password are not required
because js-import and js-export do not make changes to the database schema.
3.
This command will generate the following files with the values you added to the default_master.properties
file:
4.
<js-install>/buildomatic/build_conf/default/js.jdbc.properties
<js-install>/buildomatic/build_conf/default/js.quartz.properties (only for DB2 and PostgreSQL)
Make sure the JDBC driver for your database is located in the following folder:
<js-install>buildomatic/conf_source/iePro/lib
If necessary, you can find links for downloading JDBC drivers from the Jaspersoft Community website:
http://community.jaspersoft.com/wiki/downloading-and-installing-database-drivers
145
7.4
Buildomatic:
7.4.1
7.4.2
146
js-ant export-help-pro
js-ant export -DexportFile=my-domains.zip
-DexportArgs="--uris /organizations/organization_1/Domains"
js-ant export -DexportFile=my-reports-and-users.zip
-DexportArgs="--uris /organizations/organization_1/reports
--users jasperadmin|organization_1,joeuser|organization_1"
js-ant export -DexportFile=my-datasources
-DexportArgs="--uris /organizations/organization_1/datasources --roles ROLE_USER"
js-ant export -DexportFile=js-everything.zip -DexportArgs="--everything"
On Linux, all double quotation marks (") and other characters, such as the vertical bar (|) separating login user
and organization names must be escaped with a backslash (\). Also, when listing user names, enclose the list in
single quotation marks ('), as shown in this Linux example:
./js-ant export-help-pro
./js-ant export -DexportFile=my-reports-and-users.zip
-DexportArgs=\"--uris /organizations/organization_1/reports
--users 'jasperadmin\|organization_1,joeuser\|organization_1'\"
147
148
CHAPTER 8
APPLICATION SECURITY
This chapter describes the configuration settings that protect JasperReports Server and its users from
unauthorized access. The configuration properties appear in two locations:
Some properties must be configured during the installation and deployment phase, before users access the
server. These settings are configured through files used by the installation scripts. These settings are
available only when performing a WAR file installation.
Other properties are located in files in various folders after installation. Configuration file paths are relative
to the <js-install> directory, which is the root of your JasperReports Server installation. To change the
configuration, edit these files then restart the server.
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-6.0\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.
Do not modify settings that are not described in the documentation. Even though some settings may
appear straightforward, values other than the default may not work properly and may cause errors.
149
8.1
The password for the mail server used by the scheduler (quartz.mail.sender.password)
The password for LDAP external authentication.
Passwords in configuration files are encrypted during JasperReports Server installation. If the installation
deploys to the Tomcat application server, the database password is also automatically encrypted in the JNDI
configuration (in the file context.xml).
Full password security cannot be guaranteed from within JasperReports Server. A user with sufficient
privileges and knowledge of JasperReports Server can gain access to the encryption keys and the
configuration passwords. While you could require a password on every server restart, this is impractical
for most users. The only practical way to guarantee password security is through backup and restriction
of access to the keystore property file.
8.1.1
Depending on the database you use, copy the installation configuration file as usual:
from:<js-install>/buildomatic/sample_conf/<database>_master.properties
to:<js-install>/buildomatic/default_master.properties
2.
3.
4.
The plain text passwords in default_master.properties are overwritten with their encrypted equivalents.
There is no warning when you run js-install with encrypt=true.
b.
c.
The installation proceeds and files are copied to their final locations.
150
you may need to add the following to your Tomcat service start properties:
-Duser.home=c:\Users\<TomcatUser>
8.1.2
Deploy JasperReports Server to your enterprise server as specified in the JasperReports Server Installation
Guide. The resulting JasperReports Server instance will have unencrypted JNDI data source passwords. If
you want to encrypt these passwords, refer to your application server's documentation.
2.
After the server has been successfully configured, encrypt the JasperReports Server configuration files as
follows:
a.
b.
Run the target js-ant refresh-config, which will remove and recreate all the configuration files
without deploying them to the application server. Now the buildomatic files will have the database
passwords encrypted. You should still be able to execute import/export or other scripts.
Do not run js-install or js-ant deploy-webapp-pro. These commands will overwrite the war file
created in step 1 and render the server data sources inaccessible. If you need to redeploy the WAR file,
reset the database password(s) to plain text in your default_master.properties and start again with step 1.
8.1.3
151
<bean id="propertyConfigurer"
class="com.jaspersoft.jasperserver.api.common.properties.DecryptingPropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>/WEB-INF/hibernate.properties</value>
<value>/WEB-INF/js.quartz.properties</value>
<value>/WEB-INF/js.spring.properties</value>
<value>/WEB-INF/js.scheduling.properties</value>
<value>/WEB-INF/mondrian.connect.string.properties</value>
<value>/WEB-INF/js.diagnostic.properties</value>
<value>/WEB-INF/js.aws.datasource.properties</value>
<value>/WEB-INF/js.config.properties</value>
<value>/WEB-INF/js.externalAuth.properties</value>
</list>
</property>
...
</bean>
</pre>
The use of the ${...} syntax tells you that report.scheduler.mail.sender.password is most likely
defined via the propertyConfigurer bean. Search through the propertyConfigurer locations to verify. This
property is defined in /WEB-INF/js.quartz.properties as follows:
report.scheduler.mail.sender.password=${quartz.mail.sender.password}.
Once you've verified that the quartz.mail.sender.password property can be encrypted using defaultmaster.properties, you set up encryption before installation as follows:
1.
152
2.
3.
4.
quartz.mail.sender.password=cleartextpassword
...
encrypt=true
propsToEncrypt=dbPassword,quartz.mail.sender.password
8.1.4
5.
Configure and install your JasperReports Server war installation as described in the JasperReports Server
Installation Guide.
6.
The values referenced by the ${...} format are defined in the js.externalAuth.properties file and are imported
into Spring context via the propertyConfigurer. For example, the LDAP properties are defined in
js.externalAuth.properties as follows:
external.ldap.url=${external.ldapUrl}
external.ldap.username=${external.ldapDn}
external.ldap.password=${external.ldapPassword}
The ${...} syntax again references other configuration properties that must be set in default_master.properties
before installation or upgrade. The following example shows the syntax of the properties in the default_
master.properties file:
external.ldapUrl=ldap://hostname:389/dc=example,dc=com
external.ldapDn=cn=Administrator,dc=example,dc=com
external.ldapPassword=password
To encrypt the password property, set the following values in default_master.properties before installation or
upgrade:
external.ldapPassword=cleartextpassword
...
encrypt=true
propsToEncrypt=dbPassword, external.ldapPassword
153
During the installation process, the password value in default_master.properties and its reference in
js.externalAuth.properties are overwritten with the encrypted value.
If your external authentication mechanism is configured to create organizations for external users, as of
JasperReports Server 6.0, there is another password to encrypt. When external authentication creates an
organization, it uses the information in ExternalTenantSetupUser of the externalTenantSetupProcessor
bean to create the organization administrator.
<bean class="com.jaspersoft.jasperserver.multipleTenancy.security.externalAuth.processors.
MTAbstractExternalProcessor.ExternalTenantSetupUser">
<property name="username" value="${new.tenant.user.name.1}"/>
<property name="fullName" value="${new.tenant.user.fullname.1}"/>
<property name="password" value="${new.tenant.user.password.1}"/>
<property name="emailAddress" value="${new.tenant.user.email.1}"/>
<property name="roleSet">
<set>
<value>ROLE_ADMINISTRATOR</value>
<value>ROLE_USER</value>
</set>
</property>
</bean>
The values referenced by the ${...} format are defined in the js.config.properties file as follows:
## New tenant creation: user config
new.tenant.user.name.1=jasperadmin
new.tenant.user.fullname.1=jasperadmin
...
new.tenant.user.password.1=jasperadmin
new.tenant.user.email.1=
The default values for new tenant (organization) administrators in js.config.properties apply only to
external authentication. They do not apply to organizations created by administrators through the UI or
REST interfaces.
During the installation process, the password value in default_master.properties and its reference in
js.config.properties are overwritten with the encrypted value.
8.1.5
Encryption Options
In buildomatic installation scripts, the passwords are symmetrically encrypted: the same secret key is used for
both encryption and decryption. The key and its containing keystore file are randomly generated on each
154
machine during the first JasperReports Server installation. All the subsequent JasperReports Server installations
on the same server rely on the same keystore; they don't regenerate the key.
The keystore is an encrypted file used to securely store secret keys. JasperReports Server uses keystore properties
to access the keystore. Both the keystore and keystore properties files are created by default in the user home
directory. Alternatively, before running js-install, you can specify different locations for the keystore and
keystore properties files via the environmental variables ks and ksp.
By default, database passwords are encrypted with the AES-128 algorithm in Cipher Block Chaining mode with
PKCS5 padding. The AES algorithm is the current industry encryption standard. You can choose to modify the
encryption strength by choosing either a different algorithm, a longer secret key size (for example AES-256), or
a different encryption mode.
Edit the following properties in your default_master.properties and set these options. If a property is commented
out, the default is used:
Property
Description
Default
build.key.algo
AES
build.key.size
128 (bits)
To increase the key size, if it has not been done before, you might have
to install "Unlimited Strength Jurisdiction Policy Files" from the Oracle
site for your Java version. To install the files, download US_export_
policy.jar and local_policy.jar. AFTER backing up the old files, extract
the jars into %JAVA_HOME%/jre/lib/security directory.
Alternatively, you may download one of the reputable providers such as
Bouncy Castle (ships with JasperReports Server). You would need to
add the Bouncy Castle provider to the list in
%JAVA_HOME%/jre/lib/security/java.security file:
security.provider.<seq number>=
org.bouncycastle.jce.provider.BouncyCastleProvider
enc.transformation
AES/CBC
/PKCS5
Padding
enc.block.size
The size of the block that's encrypted. Encrypted text can contain many
blocks. Usually the block is changed together with the encryption
algorithm.
16 (bytes)
propsToEncrypt
dbPassword
8.2
155
8.2.1
8.2.2
Property
Value
Description
autoCompleteLoginForm
true <default>
false
156
8.2.3
Property
Value
Description
passwordExpirationInDays
0 <default>
<any other value>
8.2.4
Property
Value
Description
allowUserPasswordChange
false <default>
true
157
Bean
Description
allowedPasswordPattern
userAuthority
Service
When you enforce a password pattern, you should set the following message to inform users why their password
was rejected. Be sure to set the message in all your locales.
Password Administration Option
Configuration File
.../WEB-INF/bundles/jsexceptions_messages[_locale].properties
8.3
Property
Description
exception.remote.weak.password
158
Value
Description
<session-config>
<session-timeout>
20 <default>
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.
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).
8.4
In the default configuration of the server, CSRF prevention is active. We recommend leaving this setting
unchanged:
CSRF Prevention
Configuration File
.../WEB-INF/classes/esapi/security-config.properties
8.5
Property
Value
Description
security.validation.csrf.on
true <default>
false
159
Administrators can monitor the server logs to search for evidence of attempted security breaches. However, input
that was allowed in previous versions of the server may be blocked, and users may see errors when entering
values. In particular:
Parameter names and values can't 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 can't 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's 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.
Contents
<js-webapp>/WEB-INF/classes/esapi/securityconfig.properties
<js-webapp>/WEB-INF/bundles/security.properties
<js-webapp>/WEBINF/classes/esapi/security.properties
<js-webapp>/WEBINF/classes/esapi/validation.properties
Input validation is based on UTF-8 encoded input. Make sure your application server is configured
for UTF-8 URIs as described in sectionUTF-8 Configuration on page266.
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
160
Input Validation
Property
Value
Description
security.validation.input.on
true <default>
false
security.validation.sql.on
true <default>
false
8.5.1
Value
message.validation.input
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 one 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.
8.5.2
161
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. Although validators can be used in several
rules, each validation rule should be as specific as possible to the allowable input.
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. For more information about logs, see
Configuring System Logs on page199. The log message contains the name of the parameter and context
where the parameter was used.
2.
3.
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
5.
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.
b.
c.
Save your changes and redeploy the JasperReports Server webapp, or restart your application server.
Recommendations:
Try to keep the character limit as close to the expected value as possible.
Try to use a validator as close to the expected values as possible. If a parameter's value is expected to be
numbers only, use the Numeric validator.
Most validators are whitelists that specify allowed character patterns. A validator may be preceded by an
exclamation point (!) to indicate that everything but those values is 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, 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
162
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, 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
validation and reduce false-positive log messages.
8.5.3
1.
2.
Locate the validator used in the input validation rule you want 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.
Use the new value validator name in your input validation rule, as described in the previous procedure.
5.
Save your changes and redeploy the JasperReports Server webapp, or restart your application server.
8.5.4
2.
3.
4.
Save your changes and redeploy the JasperReports Server web app, or restart your application server.
163
8.5.5
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:
Queries for reports must retrieve data only, in other words, use only the SELECT statement. The following
statements are forbidden:
DROP, INSERT, UPDATE, DELETE
If you want to use stored procedures, you must add the following validator to the file <js-webapp>/WEBINF/classes/esapi/validation.properties:
Validator.ValidSPROC=^\\s*\\(((?i)call)\\s+[^;]+\\)$
And then modify the validation rule for the corresponding parameter or field where you want 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 sectionEditing Input Validation Rules on page161.
When SQL validation fails, the logs contain the message described in Customizing Security Error
Messages on page161, 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
8.5.6
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
164
Default Value
Description
log.msg.security.off
msg.no.rule
msg.cannot.load
Configuration File
.../WEB-INF/classes/esapi/security.properties
8.6
Property
Default Value
Description
DEFAULT
Alpha,AlphaNumPunctuation
Brackets,200000,true,DEFAULT
165
Value
Description
file.upload.max.size
-1
<default>
The following settings apply to most file upload dialogs in the user interface, such as uploading a JRXML or a
JAR file to create a JasperReport in the repository. These settings in the fileResourceValidator bean restrict
the file size and the filename pattern.
File Upload Restrictions
Configuration File
/WEB-INF/flows/fileResourceBeans.xml
Property
Value
Description
maxFileSize
-1
<default>
fileNameRegexp
^.+$
<default>
fileName
ValidationMessageKey
<null/>
<default>
166
The following setting restricts the extension of the uploaded file. The upload dialogs will browse only for files
with the given extensions. Add or remove extensions to change the file type restrictions:
File Upload Extensions
Configuration File
<jasperserver-pro-war>/scripts/resource.locate.js
8.7
Property
Value
ALLOWED_FILE_
RESOURCE_EXTENSIONS
Bean
Description
showStacktrace
Message
webAppSecurity
Filter
Restart your application server or redeploy the JasperReports Server web app for this change to take effect.
8.8
167
security dialog. Therefore, the server where the data is located determines which other servers may access the
data.
The following crossdomain.xml sample allows access only from the example domain or any of its subdomains.
This example is saying that the server with this file trusts only 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>
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's
being served. For example, if you use Apache Tomcat, place your files in the following locations:
168
File
Location
crossdomain.xml
<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>
8.9
To back up DB2, Oracle, Microsoft SQL Server, and MySQL databases, refer to your database product
documentation.
2.
You can now stop your application server. You should leave your database running.
3.
Export the entire contents of the repository, which includes user profiles and their passwords, with the
following commands. Note that there are two dashes (--) in front of the command options:
Windows: cd <js-install>\buildomatic
js-export.bat --everything --output-dir js-backup-catalog
Linux:
cd <js-install>/buildomatic
js-export.sh --everything --output-dir js-backup-catalog
In the export operation, passwords are decrypted using the existing user password ciphers and re-encrypted
with the import-export encryption key. This is a separate encryption that ensures that passwords are never in
plain text, even when exported. For more information, see Setting the Import-Export Encryption Key on
page136
4.
Edit the properties in the following table to configure different ciphers. Both the server and the importexport scripts access the user profiles and must be configured identically. Make the same changes in both
files:
Bean
Description
allowEncoding
passwordEncoder
169
keyInPlainText
passwordEncoder
secretKey
passwordEncoder
secretKeyAlgorithm
passwordEncoder
cipher
Transformation
passwordEncoder
You should change the secretKey value so that it is different from the default.
6.
Next, drop your existing jasperserver database, where the passwords had the old encoding, and recreate
an empty jasperserver database. Follow the instructions for your database server:
Dropping and Recreating the Database in PostgreSQL
Dropping and Recreating the Database in MySQL
Dropping and Recreating the Database in Oracle
Dropping and Recreating in the Database in Microsoft SQL Server
Import your exported repository contents with the following commands. The import operation will restore
the contents of JasperReports Server's private database, including user profiles. As the user profiles are
imported, the passwords are encrypted using the new cipher settings.
Note that there are two dashes (--) in front of the command options:
Windows: cd <js-install>\buildomatic
js-import.bat --input-dir js-backup-catalog
Linux:
cd <js-install>/buildomatic
js-import.sh --input-dir js-backup-catalog
During the import operation, passwords are decrypted with the import-export encryption key and then reencrypted in the database with the new user password encryption settings. For more information, see
Setting the Import-Export Encryption Key on page136.
170
7.
Using a database client such as the SQuirreL tool, check the contents of the JIUser table in the
jasperserver database and verify that the password column values are encrypted.
8.
9.
Log into JasperReports Server to verify that encryption is working properly during the log in process.
8.9.1
2.
3.
Drop the jasperserver database, create a new one, and load the jasperserver schema:
drop database jasperserver;
create database jasperserver encoding='utf8';
\c jasperserver
\i js-pro-create.ddl
\i quartz.ddl
8.9.2
2.
3.
Drop the jasperserver database, create a new one, and load the jasperserver schema:
mysql>drop database jasperserver;
mysql>create database jasperserver character set utf8;
mysql>use jasperserver;
mysql>source js-pro-create.ddl;
mysql>source quartz.ddl;
8.9.3
2.
3.
Drop the jasperserver database, create a new one, and load the jasperserver schema:
SQL>
SQL>
SQL>
SQL>
SQL>
8.9.4
2.
Drop the jasperserver database, create a new one, and load the jasperserver schema using the
SQLCMD utility:
171
cd <js-install>\buildomatic\install_resources\sql\sqlserver
sqlcmd -S ServerName -Usa -Psa
1> DROP DATABASE [jasperserver]
2> GO
1> CREATE DATABASE [jasperserver]
2> GO
1> USE [jasperserver]
2> GO
1> :r js-pro-create.ddl
2> GO
1> :r quartz.ddl
2> GO
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. Independent of the autocomplete
setting described in sectionConfiguring Password Memory on page156, 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.
172
Login Encryption
Configuration File
.../WEB-INF/classes/esapi/security-config.properties
Property
Value
Description
encryption.on
truefalse
<default>
encryption.type
RSA <default>
encryption.key.length
integer power of 2
1024 <default>
encryption.dynamic.key
true <default>
false
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.
8.10.1
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's sent,
and a potential attacker won't be able to steal the encrypted password to log in or send a different request.
Because it's 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 users may not always
notice. Another effect of dynamic key encryption is that it doesn't allow remembering passwords in the browser.
While this may seem inconvenient, it's more secure to not store passwords in the browser. See Configuring
Password Memory on page156.
8.10.2
JasperReports Server also supports static key encryption. In this case, a unique key pair is generated
automatically on the user's first 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 an attacker could
steal the encrypted password and use it to access the server.
173
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 can't 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 unique and secure.
For security reasons, always change the default keystore passwords immediately after installing the
server.
Value
Description
keystore.location
keystore.jks
<default>
keystore.password
jasper123 <default>
keystore.key.alias
jasper <default>
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 the key has been created with a password, you can't 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.
174
CHAPTER 9
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 and their values.
The 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 user interface (UI).
Changes to these properties take effect immediately, are stored in the repository, and override the equivalent
values stored in files, even after the server restarts (as of version 5.0).
This chapter describes a subset of the properties in the configuration files. Settings that affect security are
covered in Application Security on page149. Configuration of the auditing feature is covered in
Configuring Auditing and Monitoring on page231. 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
here 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-6.0\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.
Do not modify settings that are not described in the documentation. Even though some settings may
appear straightforward, values other than the default may not work properly and cause errors.
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 us.
In addition to configuration described in this chapter, you can configure Liferay Portal or JBoss Portal to
display the reports stored in your JasperReports Server instance. You can download the JasperReports
Server portlets for these environments from the Jaspersoft Support Portal. For information about how to
deploy the portlet, refer to the documentation in the portlet download package.
175
9.1
176
2.
3.
Find the configuration setting you want 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
Documentation
Log Settings
Ad Hoc Settings
Ad Hoc Cache
OLAP Settings
AWS Settings
Import
Export
Here are some guidelines for modifying the configuration settings that appear in the user interface (Log Settings,
Ad Hoc Settings, and OLAP Settings):
The Settings pages display a subset of the settings 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. If you modify the files and restart the server, your new file settings take effect on the server and are
visible in the UI.
177
When you change a value on the Settings pages, the new setting takes effect immediately, but the new
value is not written to the corresponding configuration file. Instead, it's 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 and is visible only to the system admin (superuser).
When the server restarts, the values in the GlobalPropertiesList take precedence over values for the same
settings in the configuration files. However, each setting is independent, so a value that's not modified in
the Settings UI is read from the configuration files.
The Settings pages display the values of the settings in effect on the server. Therefore, settings in the
GlobalPropertiesList appear on the Settings pages where they can be changed again if necessary.
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.
178
Right-click the GlobalPropertiesList and select Edit to view the configuration values it stores. If a setting
has been modified in the UI, it appears in this list so that the setting is persistent. If you want to reset a
setting so that it takes its value from the configuration file instead, click Remove next to that setting and
then restart the server. Otherwise, we do not recommend modifying this list of values directly.
9.2
The GlobalPropertiesList also includes JDBC drivers configured during the installation or through the data
source creation wizard. For more information, see Managing JDBC Drivers on page70.
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 Importing From the
Settings on page139,
179
Description
deploy.base.url
Configuration File
.../WEB-INF/js.quartz.properties
9.3
Property
Description
report.scheduler.web.deployment.uri
JasperReports Server supports a limited form of session persistence. When session persistence is enabled in the
app server, sessions can be restored in the following cases:
Browsing the repository, expanding folders in the repository tree and viewing folder contents.
Searching the repository, including all search filters and results.
Repository permissions dialog, including state and selections.
Add folder dialog.
Add resource dialogs, including adding or editing a data source, JasperReport, and other repository objects.
Copy, cut, and paste resources in the repository.
Scheduling a report, including all information such as a schedule and notifications.
If the server becomes unavailable when using the pages or dialogs above, the user will see a pause only when
performing an action on these pages, such as submitting. When the server has finished restarting, the user can
continue interacting with these UI elements. If the user takes no action while the server is unavailable, he may
not even notice the server restart.
180
However, for other interactive dialogs in JasperReports Server, the state is too large to store in the user session.
These features do not support session persistence and unsaved data can be lost:
Ad Hoc editor - The state of the report layout and data in the Ad Hoc editor can't be restored.
Dashboard designer - The contents and state of the canvas can't be restored.
Interactive report viewer - The data in the report, as well as the state of column sorting and filtering can't be
saved.
Domain designer - Any tables, joins, filters, calculated fields, and display names can't be restored.
OLAP viewer - The data in the OLAP view and current MDX expression can't be restored.
Administration dialogs (when creating or editing an organization, user, or role) - The information entered in
an administration dialog can't be restored if it was not submitted.
In the cases listed above, the user's work is interrupted, and any unsaved work is lost. However, when the server
restarts, the user does not have to log in again, the server displays a message about the session that could not be
fully restored, and redirects the user to the home page. The user must relaunch the interactive feature and
recreate any unsaved work.
Session persistence also affects web service calls. The REST API supports a login to store a session ID, and with
persistence enabled, that session ID will still be valid when the application server restarts. This simplifies the
code you need to handle timeouts. In general, web service calls do not support interactive work like designing
an Ad Hoc view, a dashboard, a Domain, or exploring data in OLAP, so they aren't affected by the lack of
session persistence in those cases. However, web service calls are affected in the following case:
Report execution - All asynchronous API calls for running and exporting reports rely on the large
JasperPrint object that can't be persisted. When the server restarts, the asynchronous calls will return errors
because the reports could not be saved in the session. Your application needs to detect this error and
include code for re-running the report.
JasperReports Server also supports session replication among multiple instances of the server in a
cluster. However, session replication has the same limitations because it is based on session
persistence. For more information, see the JasperReports Server Ultimate Guide.
The following procedure gives the configuration in JasperReports Server and the Apache Tomcat application
server to enable session persistence. For another application server, refer to that server's documentation.
To configure JasperReports Server and Apache Tomcat for session persistence:
1. Edit the file <web-app>/META-INF/context.xml to comment out the Manager property as follows:
<!-- Manager pathname="" /-->
2.
Locate the listener of class RequestContextListener and replace it with the listener of class
TolerantRequestContextListener. The new listener class is given in comments that you need to
uncomment as follows:
<listener-class>com.jaspersoft.jasperserver.core.util.TolerantRequestContextListener
</listener-class>
<!--listener-class>org.springframework.web.context.request.RequestContextListener
</listener-class-->
b.
181
<filter>
<filter-name>ClusterFilter</filter-name>
<filter-class>com.jaspersoft.jasperserver.war.TolerantSessionFilter</filter-class>
</filter>
c.
Locate the corresponding mapping for the ClusterFilter and uncomment that, too. You must also
uncomment the <distributable> element below it as follows:
<filter-mapping>
<filter-name>ClusterFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<distributable/>
3.
4.
9.4
Configuring Ad Hoc
Ad Hoc functionality is available only to JasperReports Server Professional edition users.
Ad Hoc settings help you fine-tune the Ad Hoc Editor and the views created in it. Users with ROLE_SUPERUSER
can manage the Ad Hoc settings and cache. This section covers the following ways to configure Ad Hoc:
9.4.1
Ad Hoc
Ad Hoc
Ad Hoc
Ad Hoc
Ad Hoc
Ad Hoc
Ad Hoc
Query Settings
Data Policies
Data Policies for Big Data
Templates and Report Generators
Configuration File
Cache Management
OLAP Filter Configuration
182
zero in crosstabs and in time-series (creating regular intervals). Regardless of this setting, null values are
always displayed as zero in all other chart types.
Query Limits to preserve resources used by queries when Ad Hoc views are designed and run:
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 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 will request in a
query. Be aware that JasperReports Server truncates the data displayed in the report 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 when users run
Ad Hoc views. Setting this to a higher number may prevent complex calculations from timing out, but
may use more database connections.
Data Policies that determine how JasperReports Server handles data loading and processing for certain kinds
of Ad Hoc views. See Ad Hoc Data Policies in the next section.
Select Manage > Server Settings and choose Ad Hoc Settings in the left-panel.
Set the configuration values as described above.
4.
Click Change beside each value you modified to make your changes effective. Or click Cancel to reset it
to the previously saved value.
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 Configuration Settings in the User Interface on
page176.
9.4.2
Data policies determine how data is cached and where certain calculations occur. All Ad Hoc work is based on
a query, either from a Domain or Domain Topic, or from the JRXML of a plain Topic. Data policies determine
whether the Ad Hoc engine uses the query as-is and process the data in memory, or rewrites the query so that
the database processes data and returns only what Ad Hoc needs to display.
By default, the data accessed by Domain-based reports is grouped, sorted, and aggregated in the database, rather
than processed in memory on the server. This way the server retrieves only the columns that appear in the report
rather than the entire set of fields in the Domain. As of JasperReports Server 5.5, calculated fields are also
processed by the database. For Topic queries based on JDBC (and JNDI) data sources, the default behavior is to
request the entire result set and process the columns for display in memory. Note that independent check boxes
control the behavior -- one for Domains and another for JDBC data sources.
183
When these check boxes are cleared, the server loads the entire set of fields associated with a Domain or Topic
into memory, then applies the necessary calculations, 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, we recommend 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 calculated fields, complex sorting, grouping, or
aggregation may perform better when the server optimizes the queries so that the database performs the
work.
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 data source is tuned for
maximum performance, Ad Hoc views may perform better when the server optimizes the queries.
If your data source is hosted by MySQL, we recommend that you keep the default (unchecked) for the
Optimize Queries for JDBC-based Reports setting. MySQL has poor performance with the nested
queries that this setting would generate.
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, we recommend 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.
The data polices you can set are:
Optimize Queries for JDBC-based Reports. When checked, Ad Hoc rewrites the query to calculate,
filter, group, sort, and aggregate columns when using Topics based on JDBC and JNDI data sources.
Otherwise, the queries run unaltered and calculated fields, filtering, grouping, sorting, and aggregation take
place in memory.
Optimize Queries for Domain-based Reports. When checked, Ad Hoc rewrites the query to calculate
filter, group, sort, and aggregate columns when using Domains or Domain Topics. Otherwise, the queries
run unaltered and calculated fields, filtering, grouping, sorting, and aggregation take place in memory.
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.
184
2.
Select Manage > Server Settings and choose Ad Hoc Settings in the left-hand panel.
3.
Select Optimize Queries for JDBC-based Reports to optimize and rewrite queries for JDBC-based
Topics.
4.
Select Optimize Queries for Domain-based Reports to optimize and rewrite queries for Domain-based
reports.
5.
Click Change beside each value you modified to make your changes effective. Or click Cancel to reset it
to the previously saved value.
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 Configuration Settings in the User Interface on
page176.
9.4.3
Bean
Description
calcMethod
Distinct
Count
Performing distinct count aggregates in the database applies only in the following cases:
This setting has no effect when there is a row or column group involving a time, timestamp, or date. In this case,
Ad Hoc performs the distinct count summary calculations in memory, regardless of the calcMethod setting.
9.4.4
185
Bean
Description
defaultTemplateUri
util:map
id="report
Generator
DefaultConf"
Bean
Description
templateURIParent
SQLPatternList
adhocEngine
Service
The default Ad Hoc template locations contain the default template. If you move or delete those folders in the
repository, be sure to update the definition of the default Ad Hoc template as described in the previous section.
Also, organization templates include the adhoc/templates folder so it appears in every new organization. You
should update all organization templates if you change or remove the %/templates value. For more information,
see Default Folders for Organizations on page28.
9.4.4.3 Adding Ad Hoc Report Generators
By default no custom report generators defined on the server, and none appear in the user interface.
To add a custom report generator:
1. Create a Java class that implements the com.jaspersoft.ji.adhoc.service.AdhocReportGenerator interface.
2.
186
Compile the class and place the resulting JAR file in <js-webapp>/WEB-INF/lib.
3.
Open the file .../WEB-INF/applicationContext-adhoc.xml for editing and register your class as a Spring bean
as shown in the following example:
<bean id="myCustomReportGenerator" class="com.example.myCustomReportGenerator">
<property name="id" value="my-custom-generator"/>
<property name="..." value="..."/>
...
</bean>
4.
In the same file, update the reportGeneratorFactory bean to include your custom generator bean:
<bean id="reportGeneratorFactory"
class="com.jaspersoft.ji.adhoc.service.ReportGeneratorFactoryImpl">
<property name="reportGenerators">
<list>
<ref bean="myCustomReportGenerator" />
<!--<ref bean="actualSizeReportGenerator" />-->
<!--<ref bean="letterPortraitReportGenerator" />-->
<!--<ref bean="letterLandscapeReportGenerator" />-->
<!--<ref bean="a4PortraitReportGenerator" />-->
<!--<ref bean="a4LandscapeReportGenerator" />-->
</list>
</property>
</bean>
5.
Edit the .../WEB-INF/bundles/adhoc_messages.properties file to add a UI label for your custom generator.
The key has the form ADH_REPORT_GENERATOR_<generator-id>. Add the same key to other language
bundles if you want to support other languages.
ADH_REPORT_GENERATOR_my-custom-generator=Corporate Template
6.
9.4.5
Restart the server or redeploy the JasperReports Server web app. The label for your custom generator
appears in the list of report generators when users create and save a report from an Ad Hoc view.
Description
JrxmlScriptURI
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.
realmsURI and
realmsURIParent
SQLPatternList
The repository locations where Topics should reside. The defaults are
/adhoc/topics and /public/adhoc/topics.
187
Property
Description
defaultTheme
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.
aruFolder
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.
tempFolderName
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.
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.
createColumn
CrosstabHeaders
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.
9.4.6
188
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 and when they're run. JasperReports 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 use. You can configure the Ad Hoc cache to optimize memory use and response time for your use
patterns.
9.4.6.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 and impaired performance when different users run the same
query. You can configure JasperReports Server to share cached datasets across users by editing the /WEBINF/applicationContext-datarator.xml file.
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>
189
Default Value
Description
maxBytesLocalHeap
400M
timeToIdleSeconds
1800
timeToLiveSeconds
5400
Age (min:sec) Time since the dataset was first stored in the cache.
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.
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. In JasperReports Server, log in as system administrator (superuser by default).
2.
190
Click Manage > Server Settings and choose Ad Hoc Cache in the left panel.
The Ad Hoc Cache page appears, displaying all the datasets in the cache, sorted by age.
To remove all datasets, click Clear All at the bottom of the Ad Hoc Cache page. This also clears the Teiid
cache used by virtual data sources, including a virtual data source that wraps a data source for big data.
4.
To remove a specific dataset from the cache, and click Clear beside the corresponding query.
5.
To find a specific cache entry, you can change the sorting in the upper-left by clicking Age, Last Used
Time, Memory Used, or Data Source URI.
To view the details of a specific query, including the full query string, click the query itself 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.
6.
191
JasperReports Server
Jaspersoft OLAP
Structure of cache
Sharing
Security
Applied to cache control so that users are not allowed to see privileged data.
Populating
Queries populate the cache. You can also schedule reports to pre-populate the cache
during off-hours.
Size
192
Cache Feature
JasperReports Server
Jaspersoft OLAP
Configurable, as described in
Configuring the Cache above.
Clearing selected
datasets manually
Configurable, as described in
sectionManually Clearing the Cache
above.
Clearing all
datasets manually
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 don't 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 Configuring the Cache on page189. 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.disable-Caching 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"/>
9.4.7
193
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-dataStrategy.xml
9.5
Property
Bean
Description
maxFilterValues
mdxDataStrategy
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
every time. This is the behavior of all releases before 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 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 and later, but must be enabled
manually.
9.5.1
If you have a new installation of JasperReports Server, enable snapshots to get the full server functionality.
In the future, persistent data snapshots may be enabled by default.
If you are upgrading from a release earlier than 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.
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 snapshots. Alternatively, you can enable snapshots selectively as
described below.
194
Bean
Description
snapshot
Persistence
Enabled
dataSnapshot
Service
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,
so it should remain set to true.
9.5.2
There are two ways to control snapshots at the report level. In the case above:
Data snapshots are enabled on the server, so most reports use them.
Reports that don't benefit from data snapshots can explicitly disable snapshots in their own JRXML.
As with all report-level properties, you can set server-wide default values, as described in Configuring
JasperReports Library on page212:
Data Snapshots Default Report-Level Configuration
Configuration File
.../WEB-INF/classes/jasperreports.properties
Property
Description
net.sf.jasperreports.data.cache.
persistable=false
195
Because the report-level property takes precedence over the server-level property, this enables a second way to
control snapshots:
9.5.3
9.6
196
When a Domain Topic uses data staging, it no longer uses any Domain-based optimizations (data policies)
configured in the server because those apply only to database queries. Datasets that are staged are also exempt
from the Ad Hoc cache time limits such as idle time and time-to-live. Data policies and Ad Hoc cache settings
still apply to Domain Topics that do not use data staging.
When deciding to enable data staging, you should consider the nature of your data, its size, your database
performance, and your access patterns to determine whether staging will help your views and reports run faster.
You should also perform realistic usage tests to determine the amount of memory and size of data that give you
the best performance. You can see staged datasets on the Ad Hoc cache page (Manage > Server Settings >
Ad Hoc Cache), which displays their size and fetch time.
To get the full benefit of data staging, you must ensure your server has enough physical memory allocated to
the Java virtual machine so that the cached dataset stays in memory. The cache for data staging will use disk
storage when memory is full, but response times will suffer. Therefore, you must apply data staging to carefully
selected Domain Topics so that the resulting sum of all staged datasets does not overwhelm your cache or your
Java virtual machine (JVM) memory limits.
The cache for data staging also uses disk storage so that staged datasets are persistent during server restarts.
Another advantage of staged datasets is that they allow fast reporting even when your original database has
latency or downtime issues.
9.6.1
Bean
stagingService
Description
When set to true, it allows Domain Topic creators to
configure data staging on Domain Topics. When a Domain
Topic uses data staging, its entire data set is stored
permanently in the Ad Hoc cache. By default, this is set to
false.
Configuration File
.../WEB-INF/adhoc-ehcache.xml
197
9.6.2
Property
Bean
Description
maxBytesLocalHeap
ehcache
The total size of the heap shared between the Ad Hoc cache
and the staging cache. The default is 400 MB. Use K for
kilobytes, M for megabytes, and G for gigabytes. If you expect
to have very large datasets being staged (hundreds of MB),
you should increase this number to accommodate them. This
value should still be about half of the maximum heap size you
configured for the JVM (-Xmx setting).
maxBytesLocalDisk
ehcache
Enable staging Turns on data staging for this Domain Topic. All Ad Hoc editor actions, Ad Hoc views,
and Ad Hoc reports based on this Domain Topic will use the staged data in the cache.
Time to keep query result in cache (in minutes) This value determines the refresh interval in minutes of
the staged data. At the end of every interval, the server refreshes the staged data by querying the data source
for the entire dataset again. The new staged data replaces the old staged data in the cache so that the
staging lasts indefinitely, but the dataset is renewed. Staged data is refreshed asynchronously every interval
by the server, independently of any access to the staged data by an Ad Hoc view or report.
To ensure data security, data staging is disabled when your Domain is based on a data source that is
defined with attributes. Server-level attributes are the exception and are allowed. Therefore, when a data
source is defined with organization attributes or user attributes, the data staging settings are not availabe
in the UI. For more information, see 4.1, Attributes in Data Source Definitions, on page66.
198
9.6.3
9.7
You can add items from the Domain to the Domain Topic. When you save the Domain Topic, the server
immediately retrieves the new dataset with the new items and stores it in the cache.
You cannot remove items from the Domain Topic. If you try to remove items, the Data Chooser dialog will
give an error. Look in the log file to find details about these dependencies.
You cannot turn off data staging for this Domain Topic unless all Ad Hoc views and reports based on it
have been deleted.
You can change the refresh interval of the staged data. When you save the Domain Topic, the server
immediately retrieves the dataset again and applies the new refresh interval in the future.
9.7.1
Select Manage > Server Settings and choose Log Settings in the left-panel.
In the Log Settings panel, use the drop-down selectors to change the log level for each class being logged.
199
The four logging levels indicate the type of event recorded by a logger:
Setting
Level of Information
ERROR
WARN
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.
INFO
Writes error, warning, and informational messages to the log describing significant events, such
as those that affect application performance.
DEBUG
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 without
an assigned value inherits the setting of its parent in log4j.properties.
200
The following table lists each logger name as it appears on the Log Settings page, the identifier used to find it
in the log file, and a description of the logger.
Logger Name
Identifier in Log
Description
JRJdbcQueryExe cuter
valueQueryLog
Cascading input
control parameter
resolution
FilterCore
Cascading input
control query result
caching
TokenControlLogic
Hibernate SQL
SQL
CommonDomainDataStrategy
SubFilterInputControlGenerator
Others
SQL generated for
Domain queries
JdbcBaseDataSet
Connection
handling for
Domains
DataSourceResolverImpl
Expression to JSON
converter
ExpressionJSON
Converter
Domain-based
security tests
SemanticLayerSecurityResolver
Impl
201
Logger Name
Identifier in Log
Description
Cascading input
control resolution for
Domains
DomainFilterResolver
Ad Hoc cache
activity
CachedData
JsControlledJdbcQueryExecuter
Ad Hoc
WorkingDataSet
WorkingDataSet
General controller
AdhocAjaxController
Crosstab controller
AdhocCrosstabAjaxController
Groovy code
generation for
memory datasets
GroovyGenerator
Ad Hoc AJAX
requests
adhocAjaxRequests
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. Log in as system administrator (superuser by default).
202
2.
3.
Select Manage > Server Settings and choose Log Settings in the left panel.
Scroll to the bottom of the page.
4.
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
5.
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 page204.
9.7.2
File Location
Import/Export
<js-install>\buildomatic\conf_source\iePro
JasperReports Server
If the logger is defined in the configuration file but commented out, simply remove the comment character (#) to
add the logger. Otherwise, add the loggers classname and set the logging level.
The form of a logger definition should be:
log4j.logger.<logger-classname> = <log-level>, <output-type>
where:
203
9.7.3
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.
9.8
The AWS settings page enables you to change Security Group settings without restarting the server.
The AWS configuration file allows you to change the JDBC driver used with AWS data sources.
For more information about AWS data sources, see AWS Data Sources on page75.
To change AWS Security Group settings:
1. Log in as system administrator (superuser by default).
204
2.
Click Manage > Server Settings. The Log Settings page appears.
3.
Click AWS Settings in the left-menu. The AWS Settings panel appears:
4.
Modify the following settings and click Change after each modification. Changes are effective
immediately on the server:
Enable AWS Security Group Changes: This checkbox is generally left checked. When checked the
JasperReports Server will use the instance credentials it assumes from the IAM role to grant itself access
to RDS and Redshift data services. For example, you stop your EC2 instance with JasperReports Server
on Friday. You restart it on Monday, and the instance gets a new IP address. JasperReports Server then
re-grants itself access to RDS. If you want to manage the security groups manually, un-check this box.
Security Group Name: When JasperReports Server creates security groups to support AWS data
sources on this instance, it will use this name as the basis of the security group name. When the
JasperReports Server instance is running on EC2, the EC2 instance ID will be appended. When running
outside of EC2, you must make sure that name is unique among JasperReports Server instances (i.e.
each instance should have its own name), so the IP addresses are properly granted access to the
appropriate database instances.
Security Group Description: This text will be used for the description field next to security group or
groups in the AWS console.
Security Group Ingress Public IP: Most users on EC2 should leave the this field empty.
JasperReports Server determines the IP address automatically. If you are running JasperReports Server
outside of EC2, you must determine your IP address manually and enter it in this field. It is also
possible with complex EC2 topology involving Virtual Private Clouds (VPCs) that you need to
provide your IP address manually.
205
Suppress EC2 Credentials Warning: If your JasperReports Server instance was created with no
IAM role, when you go to the data source wizard to add a data source with EC2 credentials there will
be a warning message saying there is no proper role set. Checking this box suppresses the warning and
disables the option..
Locate the jdbcConnectionMapbean and the key of your AWS database type within it. Modify this key
to specify a different JDBC driver. For example, the default driver for MySQL databases is set to the
MariaDB driver:
<entry key="mysql">
<util:map>
...
<entry key="jdbcUrl" value="jdbc:mysql://$[dbHost]:$[dbPort]/$[dbName]"/>
<entry key="jdbcDriverClass" value="org.mariadb.jdbc.Driver"/>
...
</util:map>
3.
9.9
Configuring Domains
Advanced uses of Domains may consider these configurations:
When you use Domains with certain database constructs, you may need to configure JasperReports Server:
9.9.1
206
Bean
Description
skipDomainDatabase
Validation
slConfig
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 uses the Domain.
9.9.2
9.9.3
Property
Bean
Description
specialOptimizationOn
graph
Operations
207
Hoc views remain consistent with their Domains. When on, it ensures consistency by either blocking
Domain changes that affect fields in use by any dependencies, or by updating the dependencies when there
are no fields in use. When updating a dependency, it removes the field from the list of available fields (leftpanel in the Ad Hoc editor). When off, it allows changes to Domains that will cause errors in any
dependent view. If a field is in use by a view, and this setting is off and allows the Domain to delete that
field, the view will cause an exception when opened. If afield is not in use by a view, and this setting is
off, the field is not removed from the list of available fields. If a deleted field appears in the list of available
fields, the view can still be opened, but any action on that field will cause an error.
You should turn this setting off only when a field is deleted from the data source, and the Domain can't be
modified because the field is being used by some dependencies. You then need to manually edit the
dependencies so they don't cause errors.
automatically added to each dependent Ad Hoc view. When on, any new field added to a Domain is added
to the list of available fields in every dependent view. When this setting or the previous setting is off,
dependent views are not updated with new Domain fields.
Turning Domain Dependency Checks On or Off
Configuration File
.../WEB-INF/applicationContext.xml
Property
Bean
Description
defaultDomainDependents
BlockAndUpdate
configuration
Bean
208
Bean
Description
default
AddToDomainDependents
configuration
Bean
9.9.4
Bean
Description
includeSynonyms
ForOracle
jdbcMeta
Configuration
Property
Bean
Description
accessToUnderlying
ConnectionAllowed
<Resourcename=
"jdbc/oracle"...
<value>true</value>
Configuration File
...\META-INF\context.xml
accessToUnderlying
ConnectionAllowed="true"
209
9.9.5
Bean
Description
jdbc2JavaType
Mapping
jdbcMeta
Configuration
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
Property
Bean
Description
jdbc2JavaType
Mapping
jdbcMeta
Configuration
9.9.6
210
java.lang.Boolean
java.lang.Float
java.lang.String
java.sql.Timestamp
java.lang.Byte
java.lang.Integer
java.math.BigDecimal
java.util.Date
java.lang.Character
java.lang.Long
java.sql.Date
java.lang.Double
java.lang.Short
java.sql.Time
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
Bean
Description
jdbc2Java
TypeMapping
jdbcMeta
Configuration
<entry key="OTHER">
<map>
<entry key="NVARCHAR2" value="java.lang.String"/>
</map>
</entry>
9.9.7
211
Bean
Description
codeToJdbcType
Mapping
jdbcMeta
Configuration
9.9.8
Bean
Description
tableTypes
jdbcMeta
Configuration
212
Global Applies to all reports generated by the server. Global JasperReports properties are defined in the
.../WEB-INF/classes/jasperreports.properties file.
Report Defined in the JRXML of the report and applies to that specific report.
Element Defined in the JRXML and applies to specific elements of the report.
9.10.1
You can extend JasperReports Library by implementing the public interfaces it exposes.
Such an implementation is usually stored in a JAR (Java Archive) that contains a file called jasperreports_
extension.properties, and specifies a factory 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 Library Ultimate Guide.
9.10.2
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
213
Description
net.sf.jasperreports.
crosstab.bucket.
measure.limit
9.10.3
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 Studio. Note that you
can also apply a theme to individual chart elements. Note that a chart theme can be included in a report
unit as a resource. In this case the theme is available only 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 can 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
Description
net.sf.jasperreports.
chart.ChartTheme
We recommend that you create your chart themes in Jaspersoft Studio. Click File > New > Other>Chart
Theme, then use Jaspersoft Studio to archive the new chart theme as a JAR.
Chart themes do not apply to Ad Hoc chart views.
214
9.10.4
By default, the report viewers interactivity is enabled, and reports with interactive elements (such as the table
component) are interactive when run in the web server and displayed in the viewer. If you dont want your
reports to be interactive, you can disable interactivity across the entire server by editing a configuration file.
Interactivity in the Report Viewer
Configuration File
.../WEB-INF/classes/jasperreports.properties
Property
Description
net.sf.jasperreports.
components.table.interactive
Changing this setting in this configuration file changes the behavior for the entire server. To configure this
behavior at the report, table, or column level, edit the reports JRXML properties.
9.10.5
By default, JasperReports Server exports HTML format using an HTML-based exporter. Unlike the default
exporters from previous versions of the server (html and xhtml), the new HTML exporter (html2) is more
forgiving when exporting reports that have overlapping elements while still preventing text from being cut off
due to font metrics issues.
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 an older HTML exporter in JasperReports Server, edit the following configuration file:
HTML Exporters
Configuration File
.../WEB-INF/classes/jasperreports.properties
215
HTML Exporters
Property
Description
com.jaspersoft.jasperreports.
export.html.type
Note that the properties are mutually exclusive; you can have only one uncommented at a time.
As of JasperReports Server version 5.5, if your reports include interactive elements such as the table
component (which supports sorting and filtering in the HTML viewer), you must use the html2 exporter to
enable the interactive features; the html and xhtml exporters dont support them.
9.10.6
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 are rendered using HTML5 because Flash isnt available. Note that
not all browsers support HTML5.
Note that Pro Charts are available only 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 won't be rendered.
To render Pro Charts using HTML5, edit the following configuration file:
Pro Charts Renderer
Configuration File
.../WEB-INF/classes/jasperreports.properties
216
Description
com.jaspersoft.jasperreports.
fusion.charts.render.type
Note that this property applies only to reports that rely on Pro Charts and affects only 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, 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.
9.10.7
Depending on the circumstances, a given graphical element (such as a chart, a map, or a widget) in a report can
be rendered in two ways:
When run directly in the web UI, the browser itself renders the chart.
When scheduled to run later or run in the background, an internal engine renders the chart.
By default, JasperReports Servers internal JavaScript engine is Rhino, which is an excellent solution for most
cases; most JasperReports Server users can accept this default. However, you may want to investigate other
engines if you encounter any of the following issues when scheduling chart-based reports or running them in
the background:
Poor performance when generating complex charts or charts that contain large volumes of data.
Out of memory messages.
Incorrect scaling when certain Pro Chart reports are printed.
Results that dont match those generated when the report is run directly in the web UI. For example, text
elements incorrectly sized or placed.
In such cases, we recommend using PhantomJS as the engine to execute JavaScript when generating graphical
reports that are run in the background or scheduled. PhantomJS is a headless WebKit with JavaScript API. To
use PhantomJS, download the correct version for your environment. Download PhantomJS and install it on the
computer hosting JasperReports Server. For installation instructions, refer to the documentation provided with
PhantomJS.
Once PhantomJS is installed, point JasperReports Server to its location. You can configure several options
independently: HighCharts generation, Pro Charts generation, Pro Widgets generation, and Pro Maps generation.
217
These are a server-wide settings. In a given server, all charts of the same type (HighCharts or Fusion
(Charts Pro, Maps Pro, or Widgets Pro)) must use the same JavaScript engine.
You can't use PhantomJS to render JFreeCharts. Such reports are always generated by Rhino when run
in the background or scheduled.
To configure JasperReports Server to use PhantomJS for HighCharts, edit the following properties:
JavaScript Engine Configuration for HighCharts
Configuration File
.../WEB-INF/classes/jasperreports.properties
Property
Description
com.jaspersoft.jasperreports.
highcharts.phantomjs.
executable.path
com.jaspersoft.jasperreports.
highcharts.phantomjs.
tempdir.path
com.jaspersoft.jasperreports.
highcharts.phantomjs.
executable.timeout
To configure JasperReports Server to use PhantomJS for Pro Charts (Fusion), edit the following properties:
JavaScript Engine Configuration for Pro Charts (Fusion)
Configuration File
.../WEB-INF/classes/jasperreports.properties
218
Description
com.jaspersoft.jasperreports.
fusion.phantomjs.
executable.path
com.jaspersoft.jasperreports.
fusion.phantomjs.
tempdir.path
com.jaspersoft.jasperreports.
fusion.phantomjs.
executable.timeout
By default, when Fusion-based reports are viewed in the web UI, they are generated as Flash elements.
You can configure the web UI to generate your reports using HTML5 instead. For details, see Enabling
Flash or HTML5 for Pro Charts on page216.
Description
applyRegexpToEmptyString
219
9.12.1
A scheduler misfire occurs when the scheduler cannot run a report at the designated time, for example because
JasperReports Server is offline, its database is offline, or the number of threads is limited. In this case, you can
configure the behavior of the scheduler to retry the report or skip the scheduled run.
You can set a different misfire policy for each kind of job schedule:single job, repeating job, and calendar job.
Misfire policies are defined in the Quartz Scheduler documentation and other online resources:
http://quartz-scheduler.org/documentation/quartz-2.x/tutorials/tutorial-lesson-05
http://quartz-scheduler.org/documentation/quartz-2.x/tutorials/tutorial-lesson-06
http://nurkiewicz.blogspot.com/2012/04/quartz-scheduler-misfire-instructions.html
220
Property
Description
report.quartz.misfirepolicy.
singlesimplejob
Sets the misfire policy for single jobs to one of the following:
SMART_POLICY
MISFIRE_INSTRUCTION_FIRE_NOW
MISFIRE_INSTRUCTION_IGNORE_MISFIRE_POLICY
Sets the misfire policy for repeating jobs to one of the following
values:
SMART_POLICY
MISFIRE_INSTRUCTION_FIRE_NOW
MISFIRE_INSTRUCTION_IGNORE_MISFIRE_POLICY
MISFIRE_INSTRUCTION_RESCHEDULE_NEXT_WITH_
EXISTING_COUNT
MISFIRE_INSTRUCTION_RESCHEDULE_NOW_WITH_
EXISTING_REPEAT_COUNT
MISFIRE_INSTRUCTION_RESCHEDULE_NOW_WITH_
REMAINING_REPEAT_COUNT
report.quartz.misfirepolicy.
calendarjob
Sets the misfire policy for jobs with calendar recursion to one of
the following values:
9.12.2
SMART_POLICY
MISFIRE_INSTRUCTION_IGNORE_MISFIRE_POLICY
MISFIRE_INSTRUCTION_FIRE_ONCE_NOW
MISFIRE_INSTRUCTION_DO_NOTHING
By default, if a scheduled report runs but causes an error, the scheduler sends an email to the schedule owner
and to all JasperReports Server administrators in the same organization. This is in addition to any failure
notification addresses specified on the Notifications tab of the scheduler wizard. To receive these scheduler
failure alerts, administrators must have valid email addresses defined in their user accounts.
You can also configure the scheduler to send failure notifications to different users based on roles, or turn off
failure notifications.
Configuring Scheduler Failure Notifications
Configuration File
.../WEB-INF/applicationContext-report-scheduling.xml
Entry Key
Bean
Description
administrator
Role
quartz
Scheduler
221
9.12.3
disableSending
AlertToAdmin
quartz
Scheduler
disableSending
AlertToOwner
quartz
Scheduler
The scheduler outputs reports through several channels. Most reports are emailed, but reports can also be written
to FTP folders. You can also configure the scheduler to write reports to the server's local file system. This option
is disabled by default for security reasons.
If you turn on scheduler file system output, make sure you have configured user and folder access rights
to make sure that malicious files cannot be written to your file system. The process that writes the files is
the same user that runs the application server hosting JasperReports Server.
222
Description
enableSaveToHostFS
This property also determines the scheduler's overall access to the file
system. When true, any schedule configured with a file system folder
will write to the file system. When false, no scheduled reports will write
output to the file system (FTP and email output are not affected).
However, any file system output specified in a schedule remains
defined and will again trigger file system output when this property is
true again.
9.12.4
Users can schedule reports to run at regular intervals. For simple recurrence, the default interval can be expressed
in days, hours, or minutes. To prevent users from scheduling frequent reports, you can limit the intervals to days
or hours by editing the following configuration file:
Scheduling Interval Options
Configuration File
.../WEB-INF/flows/reportJobBeans.xml
Section to Update
Description
recurrenceIntervalUnits
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"/>
223
</property>
<property name="labelMessage">
<value>job.interval.unit.minute.label</value>
</property>
</bean>
-->
9.12.5
The scheduler supports exclusion calendars to specify days or times when no report should be run, even if
scheduled. For example, you might not want a report to run on a bank holiday when the financial data would
be meaningless.
The scheduler maintains a list of named calendars, and the user interface allows the schedule creator to select a
calendar whose dates will be excluded from the schedule.
Currently, the only method to define a holiday calendar is through the REST API. You can use any browser
plug-in that acts as a REST client and can send PUT requests to JasperReports Server. Using such a plug-in,
compose and send the following REST request (header and body) to your server:
PUT http://<host>:<port>/jasperserver[-pro]/rest_v2/jobs/calendars/2014FrenchHolidays
Content-Type: application/xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<reportJobCalendar>
<calendarType>holiday</calendarType>
<description>2014 French Holidays</description>
<excludeDays>
<excludeDay>2014-01-01</excludeDay>
<excludeDay>2014-04-18</excludeDay>
<excludeDay>2014-04-21</excludeDay>
<excludeDay>2014-05-01</excludeDay>
<excludeDay>2014-05-08</excludeDay>
<excludeDay>2014-05-29</excludeDay>
<excludeDay>2014-06-09</excludeDay>
<excludeDay>2014-07-14</excludeDay>
<excludeDay>2014-08-15</excludeDay>
<excludeDay>2014-11-01</excludeDay>
<excludeDay>2014-11-11</excludeDay>
<excludeDay>2014-12-24</excludeDay>
<excludeDay>2014-12-25</excludeDay>
</excludeDays>
<timeZone>GMT+01:00</timeZone>
</reportJobCalendar>
For example, using the Poster plug-in for Firefox, you can submit this request as shown in the following figure.
The figure also shows the successful reply from the server.
224
225
Description
heartbeat.enabled=true
heartbeat.askForPermission.enabled
heartbeat.permissionGranted.enabled
All of these settings are properties that are substituted into the heartbeatBean in the .../WEBINF/applicationContext-heartbeat.xml file.
226
Bean
Description
showHelp
webHelp
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.
pagePrefix
webHelp
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.
helpContextMap
webHelp
227
228
Auditing stores key events 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 shows the overall health of your server instance. For example, it
includes values such as logged in users, currently running reports, scheduled reports, and memory use and
performance in the Ad Hoc cache. 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.
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 us.
229
230
Event
Information Collected
Log in as
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 (in milliseconds)
Report rendering time (in milliseconds)
Caching parameters
Errors that occurred
Report referenced
Scheduling parameters and values
Report output
Report delivery parameters (such as email)
Same parameters as when report is run
Resource referenced
Resource type
Resource referenced
Resource type
Event
Information Collected
User ID
User name
Email
Enabled flag
External flag
User attributes
Role ID
Role name
Role organization
Organization ID
Organization description
10.2.1
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.
Enabling Auditing and Monitoring Options
Configuration File
.../WEB-INF/js.config.properties
Property
Description
audit.records.enabled=false
monitoring.records.enabled=false
231
Configuration File
.../WEB-INF/applicationContext-audit.xml
Property
Bean
Description
isAuditPersistence
Enabled
audit
Service
10.2.2
Archiving moves audit data to separate database tables. For example if you create reports for weekly or monthly
server use based on the audit Domain, you'll never access audit logs older than a week or a 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
want to create reports on historical audit data, we provide 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
232
Property
Bean
Description
maxAudit
EventAge
ToArchive
auditService
maxAudit
EventAge
auditService
auditEvent
ArchiverTrigger
cronExpression
auditEvent
PurgerTrigger
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.
10.2.3
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. Events that are logged are used by both the audit and
monitoring subsystems, therefore disabling an event makes it unavailable for both auditing and monitoring.
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.
INTERNAL Event types used by the server itself, such as when running a scheduled report.
Use the all except *| syntax to specify only the disabled property. All others are recorded. For example:
<entry key="createFolder" value="*|folderDescription" />
233
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 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.
234
10.3.1
The audit 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 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.
These domain items are used in both general events and repository events:
Domain Item
Description
Date
Prop Type
Prop Value
235
Domain Item
Description
Time
Event Type
Type of event, such as save resource, as per event map in configuration file.
Request Type
Resource Type
Resource URI
Domain items in the following table are recorded for user events:
Domain Item
Description
Enabled
External
Full Name
Password Changed
Organization
User Name
Domain items in the following table are recorded for role events:
Domain Item
Description
External
Role Name
Organization
Domain items in the following table are recorded when a report is generated:
236
Domain Item
Description
Date
Time
10.3.2
Domain Item
Description
Resource URI
Resource Type
Datasource URI
Query
User Name
Organization
A number of Ad Hoc views and reports 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. 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, audit
events are recorded, the reports contain an up-to-the-minute record of events on your server. You can run the
reports or schedule them as needed.
The Ad Hoc views used to create each report are also included. You can open them 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.
Performance Report Generates a list of reports, 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 executed reports.
237
10.4.1
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.
In this release of JasperReports Server, the monitoring fields are limited to those that record report execution
events:
238
Domain Item
Description
Day
Domain Item
Description
Editing Action
The Ad Hoc editing step the user just performed (null for report execution):
Event Context
The context that triggered the report execution. Possible values are:
Event Type
Hour
id
Minute
Month
The time spent rendering the report after receiving the query results (dataset).
Report URI
Time Stamp
Full time and date when 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. such
as loading repository resources (report unit, data source, etc) and obtaining a
DB connection from the data source.
User Name
User Organization
Year
239
10.4.2
A number of Ad Hoc views and reports 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,
audit events are recorded, and the reports contain an up-to-the-minute record of events on your server. You can
run the reports or schedule them as needed.
The Ad Hoc views used to create each report are also included. You can open them 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 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,.
240
To
To
To
To
export audit data, use the --include-audit-events option in the export command.
export monitoring data use the --include-monitoring-events option in the export command.
import audit data, import the catalog containing audit data with the --include-audit-events option.
import monitoring data, import the catalog containing audit data with the --include-monitoringevents option.
Data in temp folders is not exported.
New JMX managed beans 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'll probably also want to connect to the JVMs JMX agent. 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 like thresholds and alarms
you can set on data from any JMX managed bean.
We provide 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. We also provide a report and an Ad Hoc Topic
to demonstrate this.
241
10.7.1
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:
When prompted to enter a username and password, give a user with the following roles:
Commercial editions:
Community project:
The following sections explain how to modify the default connection values for:
10.7.2
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 for all but the first one.
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. For example, change the port if you have JasperReports Server
running in a second app server on the same computer.
To change the port or connection name, edit one of following files:
Find the following lines and edit the values to the port number and connection name you want:
242
diagnostic.jmx.port = 10990
diagnostic.jmx.name = jasperserver
10.7.3
If you want to allow other users to establish the JMX connection from a remote management console, 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>.
10.7.4
By default, remote connections to JMX Agent are enabled and configured as described in Connecting to the
JMX Agent on page242.
.To disable remote connections, edit the applicationContext-diagnostic.xml file and make the following
changes:
Comment
Comment
Comment
Comment
out
out
out
out
To comment out a section of this XML file, surround it with <!-- and --> tags.
10.7.5
Most app servers also have a JMX agent, and if 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, 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're also
allowing anyone the app server trusts to connect.
243
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).
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.
/Public/Diagnostic/Diagnostic Data Source A custom data source that returns all of the diagnostic fields.
/Public/Diagnostic/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 AdHoc view using diagnostic fields.
244
as well as system information such as memory use. You can use this information to fine tune the performance of
your JasperReports Server instance.
To exclude an attribute, locate the MBean where it's defined and uncomment it from the
excludedDiagnosticAttributes property. For example, if you want to hide sensitive information about
your internal database, modify the diagnosticRepositoryDatabaseInfoCe MBean as follows:
245
To exclude an entire bean, comment it out or remove it from the list of beans in the
diagnosticExportingMBeansMap. For example, instead of excluding selected attributes, you could
remove the entire repository database MBean as follows:
<util:map id="diagnosticExportingMBeansMap" >
<entry key="jasperserver:name=Users" value-ref="${bean.diagnosticUsers}"/>
<entry key="jasperserver:name=Reports" value-ref="${bean.diagnosticReports}"/>
<entry key="jasperserver:name=Scheduler" value-ref="${bean.diagnosticScheduler}"/>
<entry key="jasperserver:name=Settings" value-ref="${bean.diagnosticSettings}"/>
<entry key="jasperserver:name=Repository" value-ref="${bean.diagnosticRepository}"/>
<entry key="jasperserver:name=About" value-ref="${bean.diagnosticJSAbout}"/>
<entry key="jasperserver:name=HibernateStatics"
value-ref="${bean.diagnosticHibernate}"/>
<entry key="jasperserver:name=EhCache"
value-ref="${bean.diagnosticEhCache}"/>
<entry key="jasperserver:name=ExternalInfo"
value-ref="${bean.diagnosticExternalInfo}"/>
<!-<entry key="jasperserver:name=RepositoryDatabase"
value-ref="${bean.diagnosticRepositoryDatabaseInfo}"/>
-->
</util:map>
246
applicationContext-diagnostic.xml
applicationContext-diagnostic-pro.xml
In that case, the diagnostic data source, the sample report, and the sample Topic described in Using the
Diagnostic Data in Reports on page244 will not function either. They can be deleted from the repository.
247
248
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 us.
Contact Jaspersoft sales to purchase additional user licenses. When you install the new license, the server
becomes fully functional for all users.
Delete user accounts 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 Managing Users on page32.
249
Bean
Description
<constructor-arg
type="int"
value="20"/>
dataSource
ObjectPool
Factory
If you are using JNDI data sources, you can configure the number of connections in your application server. For
more information, see the sections on JNDI in Working With Data Sources on page256.
java.lang.String
java.lang.Byte
java.lang.Short
java.lang.Integer
java.lang.Long
java.lang.Float
java.lang.Double
java.lang.Number
java.util.Date
java.sql.Date
java.sql.Time
java.sql.Timestamp
java.math.BigDecimal
java.math.BigInteger
java.lang.Boolean
java.lang.Object
Unsupported data types may occur when editing Topics manually, and sometimes with data sources for big data,
in particular MongoDB. The connector for MongoDB uses the data type of a given value in the last document
containing that value, and errors in input files may cause unexpected types. For example, omitting the single
quotes in the JSON format causes a string type to be interpreted as a numeric type.
If your Topic or Domain fields do not appear in the Ad Hoc editor, you can enable logging on the following
class to see details of fields with unsupported data types:
com.jaspersoft.ji.adhoc.metadata.AdhocTopicMetadata
250
Appendix A Troubleshooting
For information about enabling logging, see Configuring System Logs on page199.
Create a resource bundle (*.properties) and associate each of your field labels with a unique key. Use
Unicode escape sequences such as \u0153 for the character to insert international characters in your label
values.
2.
Use the $R syntax in the Topic to specify the appropriate key for the label of each desired field.
3.
When you open the Topic in the Ad Hoc Editor, the labels are displayed correctly from the resource bundle.
This method has the advantage that you can create a resource bundle for each language 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 Localization on page263.
If you apply filters to fields with large numbers of distinct values, make sure your app server is configured to
accept large input. The following table shows how to configure Apache Tomcat. For other app servers, refer to
your app server's documentation about POST operations.
Configure Apache Tomcat to Accept Large Filter Values
Configuration File
<tomcat>/conf/server.xml
251
Description
Bean
Description
maxMembers
baseCategorizer
In addition, dimensions and groups may be nested on several levels, for example Country, Province, and City. If
your row data has 100 countries, and each country has 10 provinces, and each province has 10 cities or towns,
there will be 100 x 10 x 10 = 10,000 rows in your full crosstab. If you also have two column dimension, each
with 10 members, there will be 100 columns in your crosstab and one million cells when all dimensions are
fully expanded. This scenario has several implications:
252
Nested dimensions and high cardinality dimensions quickly create huge crosstabs.
Huge crosstabs have a performance impact and take a long time to display and update.
Consider whether it's possible for users to actually read and interpret such a large crosstab.
Avoid dimensions with more than 10 members and avoid nesting many levels on each axis.
Use filters as input controls instead of hiding and expanding dimensions in the crosstab.
Appendix A Troubleshooting
For example, it's unlikely that a user can read the expanded data for more than one country at a time. The large
report in this example can be replaced with two reports, one that has only the country dimension and allows the
user to compare aggregate values from all countries, and another that displays all provinces and cities for a
single country selected by a drop-down filter list. Both reports will run much faster than the single large report,
and the user will not be blocked waiting for the report to refresh.
Description
CUSTOM_URL_IFRAME_TIMEOUT
253
Description
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 runtime.
254
Appendix A Troubleshooting
Bean
Description
autoDeleteBroken
UriReportJob
quartz
Scheduler
Value
Description
net.sf.jasperreports.export.
xls.use.timezone
true
This property can also be defined on individual elements in the report's JRXML if only certain fields should
apply the timezone.
255
Description
net.sf.jasperreports.
export.xls.ignore.graphics
Check that your database server is available and accepting TCP/IP connections from the host where
JasperReports Server is installed.
Check in your RDBMS that the username and password you're using are correct and have access to the
selected database.
Check for firewalls or network connectivity errors.
Many databases, including MySQL, also require the user grants to include the specific host from which
connections are allowed. Otherwise, when testing the JDBC connection, a connection may not be allowed even
though the username and password are correct. For more information, refer to the MySQL documentation for
setting up users.
An easy way to test connectivity from the server to the database with a particular user is to use a tool such as
SQuirreL or another DB query tool to connect to the database from the host of your JasperReports Server
instance.
A.13.1
You can enable additional logging to help you find the cause of the error. Set any or all of the following
loggers in the server settings interface or in the .../WEB-INF/log4j.properties file:
256
log4j.logger.com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.JdbcDataSourceService
log4j.logger.com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.
JndiJdbcDataSourceService
log4j.logger.com.jaspersoft.jasperserver.war.action.ReportDataSourceAction
log4j.logger.com.jaspersoft.commons.datarator.JdbcDataSet
log4j.logger.com.jaspersoft.jasperserver.war.common.JasperServerUtil
log4j.logger.com.jaspersoft.commons.semantic.dsimpl.JdbcDataSetFactory
log4j.logger.com.jaspersoft.commons.semantic.metaapi.impl.jdbc.BaseJdbcMetaDataFactoryImpl
log4j.logger.com.jaspersoft.jasperserver.war.validation.ReportDataSourceValidator
Appendix A Troubleshooting
A.13.2
JDBC Drivers
As of JasperReports Server 5.1, JDBC driver management is automated and simplified. JasperReports Server
ships with drivers for some databases, as listed in the dialog for creating data sources. If the JDBC driver for
your database is not included, the system administrator can easily upload the driver and use it immediately in a
data source.
For instructions on updating JDBC drivers without restarting the server, see Managing JDBC Drivers on
page70. For instructions on adding JDBC drivers when using JBoss, see the next section.
A.13.3
For modularity reasons, the JBoss application server does not allow web applications such as JasperReports
Server to change executable files, such as JDBC drivers, on the fly. In order for JDBC drivers to appear in the
list of available drivers and be selectable, you must configure JBoss before you use the drivers to create a JDBC
data source.
To add JDBC drivers on JBoss:
1. Download or copy the JDBC driver JAR file to the .../WEB-INF/lib/ directory.
2.
Description
resource-root path="<driver>.jar"
Locate the resource root element for the JDBC driver you
added and uncomment it. The name of the JAR file must
match exactly the name of the JDBC driver that you
upload. You can add a new resource root element if the
JDBC driver of your choice is not given in the commented
list.
3.
A.13.4
Restart JBoss.
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 allows only the user who owns PostgreSQL to connect. Enter the
following commands to connect:
257
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, see the MySQL documentation
for setting up users.
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.13.5
When you choose a JDBC driver, the data source creation wizard prompts you for the elements of the URL that
are required for your database. In some cases, you may need to add certain arguments to the JDBC 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 and
examples of optional arguments supported by the most common databases:
A.13.6
Database
PostgreSQL
jdbc:postgresql://<host>:5432/<db-name>
jdbc:mysql://<host>:3306/<db-name>?useUnicode=true&characterEncoding=UTF-8
Ingres
jdbc:ingres://<host>:II7/<db-name>;CURSOR=READONLY;auto=multi
Oracle
jdbc:oracle:thin:@<host>:1521:orcl
SQL Server
jdbc:sqlserver://<host>:1433;databaseName=<db-name>;SelectMethod=cursor
jdbc:jtds:sqlserver://<host>:1433/<db-name>
DB2
jdbc:db2://<host>:50000/<db-name>:driverType=4;currentSchema=<schemaname>;fullyMaterializeLobData=true;fullyMaterializeInputStreams=true;
progressiveStreaming=2;progresssiveLocators=2
Vertica
jdbc:vertica://<host>:5433/<db-name>
Informix
jdbc:informix-sqli://<host>:1526/<db-name>:INFORMIXSERVER=<server-name>
Vertica
jdbc:sybase:Tds:<host>:5433?ServiceName=<service-name>
As of JasperReports Server 5.6.1, TIBCO provides a set of JDBC drivers in the installed server. The TIBCO
JDBC drivers are based on the Progress DataDirect Connect drivers and support a slightly different SQL syntax
258
Appendix A Troubleshooting
than the vendors' drivers. If you see errors like the one below when running reports or creating domains that use
scalar functions, you'll need to modify your queries.
com.jaspersoft.commons.semantic.metaapi.MetaDataException: Cannot execute JDBC Query.
java.sql.SQLDataException: [TIBCO][SQLServer JDBC Driver][SQLServer]Conversion failed
when converting the varchar value 'Assets' to data type int.
For example, the following query does not work with the TIBCO JDBC drivers:
SELECT account_id+account_description AS account_concat from account
For more information, see the Progress DataDirect page on scalar functions.
A.13.7
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&autoReconnect
ForPools=true"/>
<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>
Ensure the driver for your database connection is in the <tomcat>/lib folder.
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 for JNDI datasources.
For Oracle databases, you may need to specify additional parameters in the context.xml file. For example, in
order to support in Oracle, add the following line
259
driverClassName="oracle.jdbc.OracleDriver"
validationQuery="SELECT 1 FROM dual"
accessToUnderlyingConnectionAllowed="true"
A.13.8
After defining JNDI Services on the JBoss application server, JasperReports Server does not automatically detect
the new services. To use the new JNDI services as data sources in the server, follow these steps:
1.
Define and deploy a JNDI data source in the JBoss administrator console.
2.
3.
4.
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 JNDI Data Sources on page73.
A.13.9
Follow these steps to configure JasperReports Server to use JNDI data sources with WebLogic:
1.
<resource-description>
<res-ref-name>TestDatabase</res-ref-name>
<jndi-name>jdbc/testDatabase</jndi-name>
</resource-description>
2.
<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.
In the WebLogic Admin Console, add a datasource with TestDatabase as the JNDI name.
4.
Go to the download page for Microsoft SQL Server JDBC Driver 3.0.
Do not use version 4.0 of this driver; it will not work.
260
2.
3.
Open the extracted folder sqljdbc_3.0\enu\auth, and then either the x64 or the x86 subfolder, depending on
whether your version of Windows is 64-bit or 32-bit, respectively.
Appendix A Troubleshooting
4.
Copy the file sqljdbc_auth.dll to the folder your app server automatically searches for DLLs.
For Tomcat, this is the <tomcat>\bin folder.
5.
6.
7.
8.
In the Type field, select JDBC Data Source. The page refreshes to show the fields necessary for a JDBC
data source.
9.
13. In the User Name field, enter any non-blank string you want, for example none.
14. In the Password field, enter any non-blank string you want, for example none.
15. Set the Time Zone and Save Location fields if necessary.
16. Click Test Connection and verify that the connection works.
17. Click Save to save the data source in the repository.
<space> @ # $ % & _ /
<space> @ # $ % & ( ) _ [ ] : , + - /
SQL Server
DB2
PostgreSQL
261
create a JDBC data source that uses the Hive JDBC driver. For instructions, see Hadoop-Hive Data
Sources on page81.
2.
3.
Cassandra clusters use partition keys to split data between nodes, but this imposes a certain segmentation of the
data. This segmentation is not compatible with all filtering, because it would be very inefficient. Therefore, the
definition of the partition keys in your Cassandra schema limits you to certain comparison operations on certain
fields.
In general you should avoid comparison operators other than strict equality in filters on Cassadra data sources.
The Cassandra reference documentation recommends not using the IN comparison "under most conditions."
For more details, see the Cassandra documentation of the SELECT WHERE clause in CQL(Cassandra Query
Language).
2.
3.
4.
262
APPENDIX B LOCALIZATION
By default, JasperReports Server is presented in the English language (US version), but it supports other
languages with translations that include data formats and resource bundles. Supported languages are Brazilian
Portuguese, 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 gives a few examples.
For information about localizing Domains, Topics, and reports, refer to the JasperReports Server User Guide.
This chapter contains the following sections:
B.1
263
File Name
Location
Purpose of Edits
jpivot_internal_messages.properties
WEB-INF/internal
Ja_pro_internal_messages.properties
WEB-INF/internal
userConfig.xml
WEB-INF/jpivot/print
B.1.1
1.
2.
3.
In the Region and Language dialog, select the Keyboards and Languages tab.
On the tab, install the language(s) that you need.
4.
5.
6.
7.
8.
Change the line to include the East Asian fonts that you need, such as the following:
sequence.allfonts=alphabetic/default,dingbats,symbol
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
B.1.2
264
Appendix B Localization
Value
Description
style name=
"ChartLegend"
fontName=
"DejaVu Sans"
<default>
"SansSerif"
After making changes to the default.new.jrxml file, you must rerun all Ad Hoc reports that contain
Japanese characters for them to appear.
If Japanese fonts are not installed in the server machine, you can add it in the following manner:
1.
2.
Add the new JAR to the WEB-INF/lib folder of the JasperReports Server WAR file.
3.
Edit the default.new.jrxml file as described above to specify the new font name.
4.
5.
Rerun the affected reports. Reports saved from Ad Hoc should now display correctly in the Report Viewer,
but the corresponding view may not display chart legends correctly within the Ad Hoc editor.
B.1.3
265
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
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
B.1.4
4.
5.
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 Apache FOP documentation.
You can embed any Unicode font using this procedure, though larger font files may have significantly larger
memory footprints. To keep memory requirements small, we recommend you use the smallest font file you can,
such as SimHei to support Chinese, Japanese, and Korean.
B.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.
B.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.
266
Appendix B Localization
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 don't 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, follow this procedure.
2.
At the end of this section, insert the following line before the closing tag:
URIEncoding="UTF-8"
3.
B.2.2
4.
5.
Restart Tomcat.
JBoss
Because JBoss uses Tomcat as its web connector, the configuration changes in Tomcat on page266) also
have to be made for JBoss. The only difference is that the server.xml file is located in the Tomcat deployment
directory, typically server/default/deploy/jbossweb-tomcat55.sar. Make the same configuration changes, then
restart JBoss.
B.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;
267
B.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&characterEncoding=UTF-8" />
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&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
B.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
268
Appendix B Localization
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 (PDF).
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
Linux
Windows
2.
Linux
JAVA_OPTS="$JAVA_OPTS "-Doracle.jdbc.defaultNChar=true
Windows
Because 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:
B.3
Linux
Windows
B.3.1
File Name
Location
Purpose of Edits
applicationContext.xml
WEB-INF
269
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.
B.3.2
B.3.3
2.
The URL of any OLAP data source that JasperReports Server accesses must be properly configured in the
/ji-pro/META-INF/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.
270
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:
Appendix B Localization
jdbc:postgresql://localhost:5432/foodmart_ja
B.4
Creating a Locale
When you want to create other locales for JasperReports Server, translation is only one aspect of localization.
Creating a locale includes these tasks:
B.4.1
File
Location
Purpose of Edits
*.properties files
WEB-INF/bundles
buildomatic/conf_source/iePro/bundles
jasperserver_
config.properties
WEB-INF/bundles
adhoc_masks
WEB-INF/bundles
Description
AdHocFiltersBundle.properties
adhoc_masks.properties
adhoc_messages.properties
calendar.properties
CommonBundle.properties
271
272
File in .../WEB-INF/bundles
Description
createsldatasource_messages
.properties
domain_designer_messages
.properties
HomeBundle.properties
image_descriptions_messages
.properties
Labels and messages for the AWS (Amazon Web Services) machine
images.
jasperreports_highcharts_
messages.properties
jasperreports_messages
.properties
jasperserver_config.properties
jasperserver_messages.properties
jsexceptions_messages.properties
Messages used in errors and exceptions, both in the UI and in the log
messages.
LicenseMessages.properties
logger_descriptions.properties
logger_descriptions_pro.properties
pro_nav_messages.properties
Labels and messages for the menu bar and old Home page.
querybuilder_messages.properties
Labels and messages for the Choose Data dialog (for creating a
Domain Topic before using Ad Hoc editor).
report_option_messages
.properties
ScalableInputControlsBundle
.properties
scheduling_ws.properties
security.properties
Appendix B Localization
Description
semanticLayer.properties
Labels and messages for the Domain designer and Ad Hoc data
policies.
ValidationBundle.properties
Description
ja_mondrian.properties
ja-pro_messages.properties
jpivot_messages.properties
mondrian_exception_messages
.properties
The standalone import and export tools have their own bundles located outside of the web app. The following
bundles are located in the WAR file distribution package, under the buildomatic folder. This location also holds
a copy of all bundles listed in the table above.
Default Resource Bundles for js-export.sh and js-import.sh
File in buildomatic/conf_
source/iePro/bundles
Description
ji-export-messages.properties
multi-tenancy-exportmessages.properties
multi-tenancy-importmessages.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:
273
File
Location
Description
jaspersoft_portlet_
message.properties
C:\liferay\webapps\<portlet_context_
name>\WEB-INF\bundles (where <portlet_
context_name> is the name specified when
the JasperReports Server portlet was
deployed).
Jaspersoft iReport Designer (iReport) and the iReport Plug-in for JasperReports Server (iReport plug-in) have
their own resource bundles, including:
B.4.2
Component
File
Description
iReport
ireport.properties
iReport plug-in
irplugin.properties
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
File Name
jasperserver_messages.properties
English
jasperserver_messages_en.properties
French
jasperserver_messages_fr.properties
French in Switzerland
jasperserver_messages_fr_CH.properties
For a list of Java-compliant locales, please refer to the Java web site.
274
Appendix B Localization
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 nonaccented characters. For international characters that are not in ISO-8859-1, use Unicode escape
sequences (for example \u00e9 is ).
Translate each *.properties files labels and messages into the new language.
Some of the strings in the properties files are date formats and format masks that may need to be edited for
the new locale. For more information, refer to Setting Date and Datetime Formats on page275.
3.
4.
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 Configuring
JasperReports Server for Multi-byte Fonts on page263.
The new locale is not available in JasperReports Server until you follow the steps described in
Specifying Additional Locales on page277.
B.4.3
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.
B.4.4
275
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're not applicable to
Jaspersoft OLAP.
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
3/31/09
Mar 31, 2009
March 31, 2009
Mar 31, 2009 23:59:59
=
=
=
=
short,hide
long,hide
short,medium
medium,medium
ADH_100_MASK_int_0
ADH_100_MASK_int_1
ADH_100_MASK_int_2
ADH_100_MASK_int_3
=
=
=
=
#,##0
0
$#,##0;($#,##0)
#,##0;(#,##0)
-1,234
-1234
($1,234)
(1234)
ADH_100_MASK_dec_0
ADH_100_MASK_dec_1
ADH_100_MASK_dec_2
ADH_100_MASK_dec_3
=
=
=
=
#,##0.00
0
$#,##0.00;($#,##0.00)
$#,##0;($#,##0)
-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, see:
276
http://download.oracle.com/javase/6/docs/api/java/text/DecimalFormat.html
http://download.oracle.com/javase/6/docs/api/java/text/DateFormat.html
Appendix B Localization
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:
B.5
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
B.5.1
File Name
Location
Purpose of Edits
applicationContext-security.xml
WEB-INF
jasperserver-servlet.xml
WEB-INF
277
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.
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.
B.5.2
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.
For more information about Java-complaint time zones, please refer to the Java web site.
B.5.3
278
Appendix B Localization
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.
JVM Settings for Default Time Zone
Operatin
g
System
App
Server
File
Setting
Windows
Tomcat
<apache-tomcat>\bin\setenv.bat
Linux
Both
JBoss
<jboss>\bin\run.bat
Tomcat
<apache-tomcat>/bin/setenv.sh
JBoss
<jboss>/bin/run.sh
GlassFis
h
<glassfish>/domains/domain1/config/domain.
xml
set JAVA_OPTS=%JAVA_
OPTS%
Duser.timezone=<timezon
e>
Add this line of code:
export JAVA_OPTS="$JAVA_
OPTS
Duser.timezone=<timezon
e>"
Add this line of code to <jvmoptions> section:
Duser.timezone=<timezon
e>
279
280
INDEX
&
&theme parameter 133
A
About JasperReports Server window 23
access control
administering 57
authentication 19
authorization 20
object-level permissions 60
permissions 57
repository 15
Ad Hoc
caching 189
comparison with Jaspersoft OLAP caching 192
data formats 275
data policies 183
data staging 196
date formats 276
fetch time 190
queries 182, 189
query time 190
result sets 189
views 182, 191, 240
adding
bean data sources 92-93
datatypes 98
folders 50
JDBC data sources 68
JNDI data sources 73
lists 99
queries 96
resources 50
virtual data sources 86
administering JasperReports Server
Ad Hoc 182, 188-189
Amazon Web Services 204
auditing 229
bean data sources 92
chart themes 214
configuration files 175
crosstab limit 213
data policies 182-183
data sources 65
datatypes 98
Domain validation 206
folders 50
fonts 116
general tasks 13
heartbeat 226
HTML exporter 215
HTML5 for Pro Charts 216
input controls 99
JAR files 116
JasperReports Library 212
JasperReports Server configuration 187
JDBC data sources 68
JNDI data sources 73
levels of administration 13
lists 99
localization 266, 271, 277
281
logging in as a user 62
multiple administrators 15, 25
object-level permissions 60
online help 226
organizations 12, 25, 55
passwords 156
queries 95, 182
report intervals 223
repository 14, 43, 55
resource bundles 116
resources 50
roles 17, 38
security settings 149
summary of tasks 25
Talend Integration Suite 39
users 17, 19, 25, 32
virtual data sources 86
XHTML exporter 215
administrators
general tasks 13
levels of administration 13
organization administrator 25
system administrator 13
Adobe Flash 216
Amazon Web Services 75, 204
Apache Hadoop. See Hive-Hadoop data sources. 65
Apple iOS 216
Asian fonts 263-264
attributes 21
attributes, user 107
auditing
administering 229
archiving audit events 229, 232
audit reports 237
audited events 230
configuring 231
importing and exporting audit data 241
authentication. See access control. 19
authorization. See access control. 20
B
beans. See data sources. 92
big data 81, 185
browsing the repository 16
282
C
caching. See Ad Hoc. 189
cascading input controls 109
character encoding 263
encoding forms 269
JBoss 267-269
JDBC connections 270
JDBC data sources 268
JDBC drivers 268
JNDI data sources 268
MySQL 268
non-UTF-8 character encoding 269
OLAP data sources 270
OLAP views 270
Oracle databases 268
PostgreSQL 267
Tomcat 266, 269-270
Unicode databases 270
UTF-8 266
charts
generation 217
charts, themes for 214
CLOB 210
Cloudera Impala 65
copying
folders 52
resources 16, 52
creating
datatypes 98
folders 50
input controls 101
lists 99
queries 96
resources 16
crosstab report, Out of Memory errors 213
CSS files 122, 131
custom data sources 66
D
data formats 275
data policies 182-183
data sources
administering 65
Amazon Web Services 75
bean 92
Index
types 98
date formats 275-276
default_master.properties 153
defaults
changing 175
chart themes 214
Domain validation 206
installation 12
locale 271
Oracle character sets 268
Oracle synonyms 209
PDF fonts 266
report interval scheduling option 223
roles 38
time zone 278
users 32
editing 51
Folder Template 28
moving 52
Public 16
fonts 263
administering 116
East Asian 263-264
in the repository 116
Jaspersoft OLAP 265
localization 263
multi-byte 263
non-UTF-8 fonts 269
OLAP views 265
PDF files 266
troubleshooting in exported files 116
format masks 275
deleting
folders 54
resources 16, 54
demo. See Supermart. 38
diagnostics 241
Domains
adapting reports to audiences 96
JDBC column types 210
validation 206
E
editing folders and resources 51
ehcache 198
events. See logging. 229
exporting
audit data 241
F
favicon.ico file 122
Firebug plug-in 132
Flash 216
Folder Template 28, 131
folders
creating 50
deleting 54
G
generating charts 217
GlobalPropertiesList 178
H
Hadoop-Hive data sources 81
heartbeat 21, 226
help configuration 226
HighCharts generation 217
Hive Query Language 65
HiveQL 97
HTML exporter 215
HTML5 216
283
I
Impala 65
importing
audit data 241
from the UI 139
overview 135
resources 143
input controls
adding 100
administering 99
and datatypes 98, 101-102
cascading 109
creating 101
list of values for 99
list type 99
parameters for cascading input controls 110-111
parameters for query-based input controls 110
query-based 102
saving 98-99, 102
types 100
internationalization 263
J
JAR files, administering 116
JasperAnalysis. See Jaspersoft OLAP. 11
JasperETL 39
JasperReports Library
configuring 212
extending 213
structure of a JasperReport 46
JasperReports Server
configuration 187
JasperServer. See administering JasperReports Server. 11
Jaspersoft iReport Designer
chart themes 214
resource bundles 274
Jaspersoft OLAP 38, 192, 265
Java Management Extensions (JMX) 241
JavaScript engine 217
JBoss
and UTF-8 configuration 267
JBoss Portal 175
JDBC data sources 68
JMX 241
JNDI data sources 73
284
JRXML files
reference syntax. See repository. 46
resource bundles 116
js-export command 141
js-import command 143
js.config.properties 154
js.externalAuth.properties 153
L
languages. See localization. 263
license expiration 23
Liferay Portal 175
lists
administering 99
creating 99
list type input controls 99
locales
administering 277
character encoding 269
creating 271
data formats 275
date formats 275-276
format masks 275
non-UTF-8 character encoding 270
properties 271
time zones 278
localization 263
fonts 263
JasperReports Server 271
Jaspersoft iReport Designer 274
OLAP views 265, 270
UTF-8 266
logging
audit events. See auditing. 229
system events 199
logging in as a user 62
M
maxBytesLocalDisk 198
maxBytesLocalHeap 198
maxFilterValues 194
maxHttpHeaderSize 254
maxPostSize 252
MDX query in Ad Hoc view 182
mdxDataStrategy 194
MongoDB data sources 65
Index
monitoring
configuring 231
sample reports 240
moving
folders 52
resources 16, 52
multi-byte fonts 263
multiple organizations. See organizations. 55
MySQL 184, 268
N
new.tenant.user.password.1 154
NVARCHAR2 210
O
OLAP views 21, 265, 270
online help 226
Oracle
character sets 268
CLOB 210
NVARCHAR2 210
synonyms 209
TIMESTAMP WITH LOCAL TIME ZONE 211
TIMESTAMP WITH TIME ZONE 211
organizations
admin roles 38
administering 25
default 12
folder structure 28
multiple 13, 25, 55
Organizations folder 28
searching for 27
single 12, 25
suborganizations 13
Organizations folder 28
Out of Memory errors 213
overrides_custom.css file 124
P
parameterized queries. See queries. 99
passwords
auditing 235
expiration 156
users changing 157
PDF
embedding fonts 266
Q
queries
administering 95
and Ad Hoc views 182, 189
creating 96
multiple query languages 97
parameters for cascading input controls 110
parameters for query-based input controls 110
query executors 97
using 95
query-based input controls 102
R
repo syntax 46
report.scheduler.mail.sender.password 152
reports
JasperReport 46
report intervals 223
scheduling 223
troubleshooting fonts in exported reports 116
reportSchedulerMailSender 152
repository
access control 15
administering 14, 43
browsing 16
configuring 55
design issues 55
285
events 235
folders 14
importing and exporting 135
Organizations folder 28
Public folder 16
reference syntax 46
referencing resources 56
resources 14, 46
sample data 15
searching 16, 40
structure 14
UTF-8 encoding 267-268
resource bundles
in the repository 116
See also localization. 274
resources
adding 50
browsing 16
copying 16
cutting 16
deleting 16, 54
editing 51
fonts 116
importing and exporting 135
in repository 46
JAR files 116
moving 52
pasting 16
queries 95
resource bundles 116
resource references in JRXML files. See
repository. 46
searching 16
result sets 189
Rhino 217
roles
administering 17, 38
administrative 25
and users 38
default roles 38
object-level permissions 60
searching for 40
T
Talend Integration Suite (TIS EE) 39
themes
&theme parameter 133
active theme 121
CSS files 122, 131
custom overrides 124
default theme 121
downloading 129
Firebug plug-in 132
in the Folder Template 131
inheritance mechanism 123
inherited theme 121
Jaspersoft iReport Designer 214
permissions 127
recovering from inadvertent changes 133
sample galleries 134
See also chart themes. [themes
&&] 119
system theme 121
Themes folder 120
uploading 130
URL parameter 133
ZIP archive 128
third-party APIs 116
time zones 278
TIMESTAMP WITH LOCAL TIME ZONE 211
TIMESTAMP WITH TIME ZONE 211
Tomcat 266
translations 263
saving
input controls 98-99, 102
286
Index
U
Unicode Transformation Format (UTF-8). See character
encoding. 266
Universal Resource Identifiers (URI) 56
user attributes
and auditing 231
and query-based input controls 107
User attributes 35
user interface samples 133
users
administering 17, 19, 32
authenticating 19-20, 57
changing passwords 157
default users 32
logging in as 62
object-level permissions 60
roles 38
searching for 33
session timeout 158
V
version of the software 23
views 21
virtual data sources 86
W
web services 233
X
XHTML exporter 215
287
288