Java Reference
In-Depth Information
Built-in Parameter
Description
REPORT_MAX_COUNT
Indicates the maximum number of records
that will be processed by the report.
REPORT_SCRIPTLET
When a report uses a scriptlet, this parameter
returns a reference to it. If the report does
not use a scriptlet, this parameter returns
an instance of net.sf.jasperreports.
engine.JRDefaultScriptlet .
REPORT_VIRTUALIZER
Very large reports some times are too large to
be handled by the available memory. Setting
this parameter to an instance of a class
implementing net.sf.jasperreports.
engine.JRVirtualizer , will allow
JasperReports to store temporary data in
serialized form in order to reduce the amount
of memory required to fill the report.
Some of the built-in parameters might not make sense yet. They will make more
sense as we discuss some more JasperReports features in future chapters. The
primary use of the REPORT_CONNECTION and REPORT_DATA_SOURCE built-in
parameters is for passing them to subreports, which are discussed in detail in the
next chapter. Report localization and report scriptlets will be covered in Chapter 8.
Map Datasources
JasperReports allows us to use instances of any class implementing the java.util.
Map interface as a datasource. We can use either an array or a collection of Map
objects to generate a report. Each Map in the collection or array is a record that will
be used to generate the data for each row inside the <detail> tag of the report.
The JasperReports API provides an implementation of net.sf.jasperreports.
engine.JRDataSource called net.sf.jasperreports.engine.data.
JRMapArrayDataSource that will enable us to use an array of Map objects as a
datasource. The following example demonstrates this class in action:
package net.ensode.jasperbook;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.HashMap;
import java.util.Map;
Search WWH ::




Custom Search