Using Parameters

Parameters are values usually passed to the report from the application that originally requested it. They can be used for configuring features of a particular report during report generation (such as the value to use for a condition in a SQL query) and to supply additional data to the report that cannot properly provided by the data source (for example, a custom title for the report, an application-specific path to search for images, or even a more complex object like an image).

Report parameters are used in many different ways inside a report. They can be used in the where condition of an SQL query, or to provide additional data to the report (for example, the a value for a title or the name of user that executed the report). A parameter is defined by a name and a Class, which is a Java class type like java.lang.String or java.lang.Integer. Any Java class is a valid parameter class. In example a parameter of type java.sql.Connection may be used to populate a subreport, while a simple java.lang.Boolean parameter may be used to show or hide a section of the report.

This chapter contains the following sections:

Managing Parameters
Default Parameters
Using Parameters in Queries
Parameters Prompt