Class Sample1
- java.lang.Object
- 
- org.pentaho.reporting.engine.classic.samples.AbstractReportGenerator
- 
- org.pentaho.reporting.engine.classic.samples.Sample1
 
 
- 
 public class Sample1 extends AbstractReportGenerator Generates a report in the following scenario:- The report definition file is a .prpt file which will be loaded and parsed
- The data factory is a simple JDBC data factory using HSQLDB
- There are no runtime report parameters used
 
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from class org.pentaho.reporting.engine.classic.samples.AbstractReportGeneratorAbstractReportGenerator.OutputType
 
- 
 - 
Constructor SummaryConstructors Constructor Description Sample1()Default constructor for this sample report generator
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description org.pentaho.reporting.engine.classic.core.DataFactorygetDataFactory()Returns the data factory which will be used to generate the data used during report generation.org.pentaho.reporting.engine.classic.core.MasterReportgetReportDefinition()Returns the report definition which will be used to generate the report.Map<String,Object>getReportParameters()Returns the set of runtime report parameters.static voidmain(String[] args)Simple command line application that will generate a PDF version of the report.- 
Methods inherited from class org.pentaho.reporting.engine.classic.samples.AbstractReportGeneratorgenerateReport, generateReport
 
- 
 
- 
- 
- 
Method Detail- 
getReportDefinitionpublic org.pentaho.reporting.engine.classic.core.MasterReport getReportDefinition() Returns the report definition which will be used to generate the report. In this case, the report will be loaded and parsed from a file contained in this package.- Specified by:
- getReportDefinitionin class- AbstractReportGenerator
- Returns:
- the loaded and parsed report definition to be used in report generation.
 
 - 
getDataFactorypublic org.pentaho.reporting.engine.classic.core.DataFactory getDataFactory() Returns the data factory which will be used to generate the data used during report generation. In this example, we will return null since the data factory has been defined in the report definition.- Specified by:
- getDataFactoryin class- AbstractReportGenerator
- Returns:
- the data factory used with the report generator
 
 - 
getReportParameterspublic Map<String,Object> getReportParameters() Returns the set of runtime report parameters. This sample report uses the following three parameters:- Report Title - The title text on the top of the report
- Customer Names - an array of customer names to show in the report
- Col Headers BG Color - the background color for the column headers
 - Specified by:
- getReportParametersin class- AbstractReportGenerator
- Returns:
- nullindicating the report generator does not use any report parameters
 
 - 
mainpublic static void main(String[] args) throws IOException, org.pentaho.reporting.engine.classic.core.ReportProcessingException Simple command line application that will generate a PDF version of the report. In this report, the report definition has already been created with the Hitachi Vantara Report Designer application and it located in the same package as this class. The data query is located in that report definition as well, and there are a few report-modifying parameters that will be passed to the engine at runtime. The output of this report will be a PDF file located in the current directory and will be namedSimpleReportGeneratorExample.pdf.- Parameters:
- args- none
- Throws:
- IOException- indicates an error writing to the filesystem
- org.pentaho.reporting.engine.classic.core.ReportProcessingException- indicates an error generating the report
 
 
- 
 
-