Java Code Examples for org.pentaho.reporting.engine.classic.core.MasterReport#addPreProcessor()

The following examples show how to use org.pentaho.reporting.engine.classic.core.MasterReport#addPreProcessor() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AutoTableAPIDemo.java    From pentaho-reporting with GNU Lesser General Public License v2.1 5 votes vote down vote up
/**
 * Creates the report. For XML reports, this will most likely call the ReportGenerator, while API reports may use this
 * function to build and return a new, fully initialized report object.
 *
 * @return the fully initialized JFreeReport object.
 * @throws ReportDefinitionException if an error occured preventing the report definition.
 */
public MasterReport createReport() throws ReportDefinitionException
{
  final DriverConnectionProvider drc = new DriverConnectionProvider();
  drc.setDriver("org.hsqldb.jdbcDriver");
  drc.setUrl("jdbc:hsqldb:./sql/sampledata");
  drc.setProperty("user", "sa");
  drc.setProperty("password", "");
  final SQLReportDataFactory sqlDataFactory = new SQLReportDataFactory(drc);
  sqlDataFactory.setQuery("default", "      SELECT\n" +
      "           QUADRANT_ACTUALS.REGION,\n" +
      "           QUADRANT_ACTUALS.DEPARTMENT,\n" +
      "           QUADRANT_ACTUALS.POSITIONTITLE,\n" +
      "           QUADRANT_ACTUALS.ACTUAL,\n" +
      "           QUADRANT_ACTUALS.BUDGET,\n" +
      "           QUADRANT_ACTUALS.VARIANCE\n" +
      "      FROM\n" +
      "           QUADRANT_ACTUALS\n" +
      "      ORDER BY\n" +
      "          REGION, DEPARTMENT, POSITIONTITLE", null, null);

  final MasterReport report = new MasterReport();
  report.setDataFactory(sqlDataFactory);
  report.setQuery("default");
  report.addPreProcessor(new RelationalAutoGeneratorPreProcessor());
  return report;
}
 
Example 2
Source File: Sample4.java    From pentaho-reporting with GNU Lesser General Public License v2.1 5 votes vote down vote up
private MasterReport createReportDefinition() {
  // Create a report using the autogenerated fields
  final MasterReport report = new MasterReport();
  report.addPreProcessor( new RelationalAutoGeneratorPreProcessor() );
  // Add the data factory to the report
  report.setDataFactory( new TableDataFactory( "Sample4Query", new Sample4TableModel() ) );
  report.setQuery( "Sample4Query" );

  // return
  return report;
}
 
Example 3
Source File: Sample2.java    From pentaho-reporting with GNU Lesser General Public License v2.1 5 votes vote down vote up
/**
 * 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.
 *
 * @return the loaded and parsed report definition to be used in report generation.
 */
public MasterReport getReportDefinition() {
  final MasterReport report = new MasterReport();
  report.setQuery( QUERY_NAME );
  report.addPreProcessor( new RelationalAutoGeneratorPreProcessor() );
  return report;
}