Class JasperReport

java.lang.Object
net.sf.jasperreports.engine.base.JRBaseReport
net.sf.jasperreports.engine.JasperReport
All Implemented Interfaces:
Serializable, JRChangeEventsSupport, JRDefaultStyleProvider, JRIdentifiable, JRPropertiesHolder, JRReport
Direct Known Subclasses:
TableJasperReport

public class JasperReport extends JRBaseReport
Instances of this class represent compiled report template objects. They are obtained only through the JasperReports report compilation process and are ready to use for filling with data and report generation.

Through compilation, along with various consistency checks and rearrangements of the report elements for more rapid performance in the application, the library creates an on-the-fly class file (or a script, depending on the type of the report compiler used) containing all the report expressions (such as report variables expressions, text field and image expressions, and group expressions). This class or script is used to evaluate report expressions during the report-filling process at runtime.

The main difference between a compiled report and a report design is that reports are already compiled and validated, so many characteristics are read only.

Author:
Teodor Danciu (teodord@users.sourceforge.net)
See Also:
  • Constructor Details

    • JasperReport

      public JasperReport(JRReport report, String compilerClass, Serializable compileData, JRExpressionCollector expressionCollector, String compileNameSuffix)
      Constructs a report by specifying the template report and compile information.
      Parameters:
      report - the report template
      compilerClass - the name of the class used to compile the report
      compileData - the report/main dataset compile data
      expressionCollector - instance used to collect expressions from the report design
      compileNameSuffix - unique string used to distinguish between distinct compilations of reports having the same name

      The collector is used to fetch the generated expression IDs.

    • JasperReport

      public JasperReport(JRReport report, String compilerClass, Serializable compileData, JRBaseObjectFactory factory, String compileNameSuffix)
  • Method Details

    • getCompilerClass

      public String getCompilerClass()
      Returns the name of the compiler class used to compile this report.

      The compiler is used to instantiate expression evaluators.

      Returns:
      the name of the compiler class used to compile this report
    • getCompileData

      public Serializable getCompileData()
      Returns data resulted from the expression evaluators compilation.

      This data is used to create expression evaluators for report filling.

      Returns:
      expression evaluators compiled data
    • getCompileNameSuffix

      public String getCompileNameSuffix()
      Returns the suffix of the class/unit names generated at report compilation.

      This is used to distinguish between disctinct compilations of reports having the same name.

      Returns:
      the suffix of the class/unit names generated at report compilation