The metadata repository is a database that holds configurable resources required for business intelligence. The repository is organized into folders, and resources can appear anywhere in the folder hierarchy. Every resource has a name, label, description and type associated with it.
The individual reports that people can run are reflected in JasperReports Server as "Report Units". A report unit contains all the required resources to produce a report, which are below:
- JRXML: the JasperReports definition file
- Data source: A database connection to populate the report.
- Additional resource types which can be used on an as needed basis include:
- Sub reports
- JAR files for JasperReports scriptlets
- Data types for report parameters
- Input controls: groupings of data types
- Resource bundles for localization/internationalization
A report unit can contain private resources only for use by the given report unit, or can refer to resources in the metadata repository that exist independently of a given report unit: eg. there may be a data source, image or font that is useful across report units. In planning your use of the repository for reporting, consider what resources would be useful across different report units. For example, you are likely to have a limited number of data sources with multiple reports using each data source, so set up the data sources once and then refer to them in the report units. There may be other resources like a common company logo image or departmental resources that a number of reports will refer to.
JRXML and the Metadata Repository
Usually, JasperReports relies on finding resources it needs either within its libraries (standard fonts) or on the classpath (images, sub reports). JasperReports Server changes the way that JasperReports runs by allowing resources to be pulled interactively from the metadata repository. For example, an image on the classpath can be referred to in JRXML as: "images/MyLogo.jpg". The JRXML to refer to an image from the metadata repository would be: "repo:images/MyLogo.jpg".
JasperReports Server will look for an image file named MyLogo.jpg in the images folder.
Input Controls and Data Types
JasperReports allows external parameters to be provided to customize the functionality of a JasperReport. JasperReports Server includes a variety of "Input Controls" that can be mapped to these parameters. When the report unit is run, the user is prompted to select or fill in the controls with values for the parameters. These values are validated as needed before they are passed on to the report.
Multiple Input Controls may be included in a single report unit. The types of Input Controls are:
- Single Select (text field)
- Single Select from a list of values (list box)
- Boolean (check box)
- Multiple Select from a list of values - not implemented
- Multiple Select - not implemented
Since the end-user is free to enter any value into a Single Select Input Control, validation is required. Each Single Select control is associated with a Data Type that defines the validation rules for that control. The Data Type is a resource in the metadata repository and thus has a name, label, and description. In addition, Data Types have the following attributes:
- Type: Text, Number, Date, Date/Time
- Pattern: formatting related to the underlying Java data type
- Minimum Value, Maximum Value: range of values, can be open-ended in one direction
- Is strict minimum, Is strict maximum: values have to be strictly less than or greater than, not equal to
- Mandatory: a value is required
- Read only: the value cannot be altered by the user
The user names and passwords for the application are stored in the metadata repository and use form-based authentication. By default, passwords are unencrypted in the database, though this can be changed through straight forward configuration. Based on the use of the Acegi Security framework, the authentication mechanism can be changed to use external authentication services like LDAP. The application does not currently manage the distinction between externally defined users and roles. We will work to allow externally authenticated users to have seamless access to reports by "inheriting" the roles external authentication services present to JasperReports Server.