Default Parameters

JasperReports provides some built-in parameters (they are internal to the reporting engine) that you may read but cannot modify. Some the most important are the "REPORT_CONNECTION", which holds the JDBC connection used to run the SQL query of the report (if the report is filled using a JDBC connection), the "REPORT_DATA_SOURCE" which contains, if available, the data source used to fill the report, the "REPORT_LOCALE" which contains the Locale used to fill the report and so on.

Some built-in parameters are specific of some query languages, in example when using the Hibernate query language, the reports automatically includes the parameter "HIBERNATE_SESSION" that holds the Hibernate session used to run the HQL query. As said, the built-in parameters can not be modified or deleted.

The built-in parameters are:

JasperReports Default Parameters

Parameter

Description

REPORT_CONTEXT

 

REPORT_PARAMETERS_MAP

This is the java.util.Map passed to the fillReport method; it contains the parameter values defined by the user.

JASPER_REPORT

 

REPORT_CONNECTION

This is the JDBC connection passed to the report when the report is created through a SQL query.

REPORT_MAX_COUNT

This is used to limit the number of records filling a report. If no value is provided, no limit is set.

REPORT_DATA_SOURCE

This is the data source used by the report when it is not using a JDBC connection.

REPORT_SCRIPTLET

This represents the scriptlet instance used during creation. If no scriptlet is specified, this parameter uses an instance of net.sf.jasperreports.engine.JRDefaultScriptlet.

REPORT_LOCALE

This is used to set the locale used to fill the report. If no locale is provided, the system default is used.

REPORT_RESOURCE_BOUNDLE

This is the resource bundle loaded for this report.

REPORT_TIME_ZONE

This is used to set the time zone used to fill the report. If no value is provided, the system default is used.

REPORT_FORMAT_FACTORY

This is an instance of a net.sf.jasperreports.engine.util.FormatFactory. The user can replace the default one and specify a custom version using a parameter. Another way to use a particular format factory is by setting the report property format factory class.

REPORT_CLASS_LOADER

This parameter can be used to set the class loader to use when filling the report.

REPORT_URL_HANDLER_FACTORY

Class used to create URL handlers. If specified, it replaces the default.

REPORT_FILE_RESOLVER

This is an instance of net.sf.jasperreports.engine.util.FileResolver used to resolve resource locations that can be passed to the report in order to replace the default implementation.

REPORT_TEMPLATES

This is an optional collection of styles (JRTemplate) that can be used in the report in addition to the ones defined in the report.

SORT_FIELDS

 

FILTER

 

REPORT_VIRTUALIZER

This defines the class for the report filler that implements the JRVirtualizer interface for filling the report.

IS_IGNORE_PAGINATION

You can switch the pagination system on and off with this parameter (it must be a Boolean object). By default, pagination is used except when exporting to HTML and Excel formats.

Version: 
Feedback
randomness