public abstract class AbstractReportGenerator extends Object
embedding
of the reporting engine and report generation. All example embedded implementations will need to extend this class
and perform the following:
getReportDefinition()
method and return the report definition (how the report
definition is generated is up to the implementing class).
getTableDataFactory()
method and return the data factory to be used (how
this is created is up to the implementing class).
getReportParameters()
method and return the set of report parameters to be used.
If no report parameters are required, then this method can simply return null
Modifier and Type | Class and Description |
---|---|
static class |
AbstractReportGenerator.OutputType
The supported output types for this sample
|
Constructor and Description |
---|
AbstractReportGenerator()
Performs the basic initialization required to generate a report
|
Modifier and Type | Method and Description |
---|---|
void |
generateReport(AbstractReportGenerator.OutputType outputType,
File outputFile)
Generates the report in the specified
outputType and writes it into the specified
outputFile . |
void |
generateReport(AbstractReportGenerator.OutputType outputType,
OutputStream outputStream)
Generates the report in the specified
outputType and writes it into the specified
outputStream . |
abstract org.pentaho.reporting.engine.classic.core.DataFactory |
getDataFactory()
Returns the data factory used by this report generator.
|
abstract org.pentaho.reporting.engine.classic.core.MasterReport |
getReportDefinition()
Returns the report definition used by this report generator.
|
abstract Map<String,Object> |
getReportParameters()
Returns the set of parameters that will be passed to the report generation process.
|
public AbstractReportGenerator()
public abstract org.pentaho.reporting.engine.classic.core.MasterReport getReportDefinition()
null
,
the report generation process will throw a NullPointerException
.public abstract org.pentaho.reporting.engine.classic.core.DataFactory getDataFactory()
null
,
the report generation process will use the data factory used in the report definition.public abstract Map<String,Object> getReportParameters()
null
Map
null
if no
parameters are required.public void generateReport(AbstractReportGenerator.OutputType outputType, File outputFile) throws IllegalArgumentException, IOException, org.pentaho.reporting.engine.classic.core.ReportProcessingException
outputType
and writes it into the specified
outputFile
.outputType
- the output type of the report (HTML, PDF, HTML)outputFile
- the file into which the report will be writtenIllegalArgumentException
- indicates the required parameters were not providedIOException
- indicates an error opening the file for writingorg.pentaho.reporting.engine.classic.core.ReportProcessingException
- indicates an error generating the reportpublic void generateReport(AbstractReportGenerator.OutputType outputType, OutputStream outputStream) throws IllegalArgumentException, org.pentaho.reporting.engine.classic.core.ReportProcessingException
outputType
and writes it into the specified
outputStream
.
It is the responsibility of the caller to close the outputStream
after this method is executed.outputType
- the output type of the report (HTML, PDF, HTML)outputStream
- the stream into which the report will be writtenIllegalArgumentException
- indicates the required parameters were not providedorg.pentaho.reporting.engine.classic.core.ReportProcessingException
- indicates an error generating the report