Java Code Examples for org.pentaho.reporting.engine.classic.core.ClassicEngineBoot

The following examples show how to use org.pentaho.reporting.engine.classic.core.ClassicEngineBoot. These examples are extracted from open source projects. 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
public void writeReport( final WriteableDocumentBundle bundle, final MasterReport report,
    final DocumentBundle globalBundle ) throws IOException, BundleWriterException {
  if ( bundle == null ) {
    throw new NullPointerException();
  }
  if ( report == null ) {
    throw new NullPointerException();
  }
  if ( globalBundle == null ) {
    throw new NullPointerException();
  }

  final WriteableDocumentMetaData data = bundle.getWriteableDocumentMetaData();
  data.setBundleType( ClassicEngineBoot.BUNDLE_TYPE );

  final MasterReport clone = (MasterReport) report.derive();
  final BundleWriterState state = new BundleWriterState( clone, globalBundle, this );
  for ( int i = 0; i < masterWriter.length; i++ ) {
    final BundleWriterHandler handler = masterWriter[i];
    handler.writeReport( bundle, state );
  }
}
 
Example 2
public void testLargeValidTableInExcelMode() throws Exception {
  if ( DebugReportRunner.isSkipLongRunTest() ) {
    return;
  }

  ClassicEngineBoot.getInstance().getEditableConfig().setConfigProperty(
      "org.pentaho.reporting.engine.classic.core.layout.process.EnableCountBoxesStep", "true" );
  ClassicEngineBoot.getInstance().getEditableConfig().setConfigProperty(
      "org.pentaho.reporting.engine.classic.core.layout.ParanoidChecks", "false" );
  MasterReport report = DebugReportRunner.parseGoldenSampleReport( "Prd-4606-0001.prpt" );
  CompoundDataFactory dataFactory = (CompoundDataFactory) report.getDataFactory();
  SequenceDataFactory sequenceDf = (SequenceDataFactory) dataFactory.getReference( 0 );
  PerformanceTestSequence sequence = (PerformanceTestSequence) sequenceDf.getSequence( "Query 1" );
  sequence.setParameter( "limit", 20000 );

  StopWatch sw = StopWatch.startNew();
  DebugReportRunner.createXmlFlow( report );
  DebugLog.log( sw );
}
 
Example 3
@Test
public void testInvalidTemplateOnSubReport() throws Exception {
  URL resource = getClass().getResource( "Prd-5295.prpt" );
  ResourceManager mgr = new ResourceManager();
  MasterReport report = (MasterReport) mgr.createDirectly( resource, MasterReport.class ).getResource();

  ExtractLogicalPageTemplateListener tlp = new ExtractLogicalPageTemplateListener();
  GenericExpressionRuntime runtime = new GenericExpressionRuntime();
  runtime.getProcessingContext().getOutputProcessorMetaData().initialize(
      ClassicEngineBoot.getInstance().getGlobalConfig() );
  final OutputProcessor op =
      new TemplatingOutputProcessor( runtime.getProcessingContext().getOutputProcessorMetaData(), tlp );

  GroupHeader band = report.getRelationalGroup( 0 ).getHeader();
  SubReport sr = band.getSubReport( 0 );

  DebugReportRunner.resolveStyle( sr );
  DebugReportRunner.resolveStyle( sr.getPageHeader() );
  FastSheetLayoutProducer.performLayout( sr.getPageHeader(), runtime, op );

  LogicalPageBox pageBox = tlp.getPageBox();
  Assert.assertEquals( 0, pageBox.getHeight() );
}
 
Example 4
private void writeConnectionInfo( final WriteableDocumentBundle bundle,
                                  final BundleWriterState state,
                                  final XmlWriter xmlWriter,
                                  final DataSourceProvider connectionProvider )
  throws IOException, BundleWriterException {
  final String configKey =
    MondrianDataFactoryModule.DATASOURCE_BUNDLEWRITER_PREFIX + connectionProvider.getClass().getName();
  final Configuration globalConfig = ClassicEngineBoot.getInstance().getGlobalConfig();
  final String value = globalConfig.getConfigProperty( configKey );
  if ( value == null ) {
    throw new BundleWriterException( "Unable to locate writer for " + connectionProvider.getClass().getName() );
  }
  final DataSourceProviderBundleWriteHandler handler = ObjectUtilities.loadAndInstantiate
    ( value, AbstractMDXDataFactoryBundleWriteHandler.class, DataSourceProviderBundleWriteHandler.class );
  if ( handler == null ) {
    throw new BundleWriterException( "Invalid write-handler for " + connectionProvider.getClass().getName() );
  }
  handler.write( bundle, state, xmlWriter, connectionProvider );
}
 
Example 5
private static Configuration wrapForCompatibility( final MasterReport processingContext ) {
  final Integer compatibilityLevel = processingContext.getCompatibilityLevel();
  if ( compatibilityLevel == null || compatibilityLevel < 0 ) {
    return processingContext.getConfiguration();
  }

  if ( compatibilityLevel < ClassicEngineBoot.computeVersionId( 3, 999, 999 ) ) {
    // enable strict compatibility mode for reports older than 4.0.
    final HierarchicalConfiguration config = new HierarchicalConfiguration( processingContext.getConfiguration() );
    config.setConfigProperty( "org.pentaho.reporting.engine.classic.core.legacy.WrapProgressMarkerInSection", "true" );
    config.setConfigProperty( "org.pentaho.reporting.engine.classic.core.legacy.StrictCompatibility", "true" );
    return config;
  }

  // this is a trunk or 4.0 or newer report.
  return processingContext.getConfiguration();
}
 
Example 6
/**
 * This constructor exists for test-case use only. If you use this to process a real report, most of the settings of
 * the report will be ignored and your export will not work as expected.
 */
public DefaultProcessingContext() {
  outputProcessorMetaData = new GenericOutputProcessorMetaData();
  resourceBundleFactory = new DefaultResourceBundleFactory();
  configuration = ClassicEngineBoot.getInstance().getGlobalConfig();
  resourceManager = new ResourceManager();
  reportEnvironment = new CachingReportEnvironment( new DefaultReportEnvironment( configuration ) );
  try {
    this.contentBase = resourceManager.createKey( new File( "." ) );
  } catch ( ResourceKeyCreationException rkce ) {
    this.contentBase = null;
  }
  formulaContext =
      DefaultFormulaContextFactory.INSTANCE.create( resourceBundleFactory.getLocale(), resourceBundleFactory
          .getTimeZone() );
  metaData = new MemoryDocumentMetaData();
  compatibilityLevel = -1;
}
 
Example 7
public void performMigration( final ReportDesignerContext designerContext,
                              final ReportDocumentContext reportRenderContext ) {
  this.reportRenderContext = reportRenderContext;

  toVersion = ClassicEngineBoot.computeCurrentVersionId();

  final MasterReport masterReportElement = this.reportRenderContext.getContextRoot();
  final Integer compatibilityLevel = masterReportElement.getCompatibilityLevel();
  if ( compatibilityLevel == null ) {
    fromVersion = toVersion;
  } else {
    fromVersion = compatibilityLevel;
  }

  setupFromReportVersion();
  if ( super.performEdit() == false ) {
    return;
  }

  if ( ( new SaveReportAction() ).saveReport( designerContext, reportRenderContext, this ) == false ) {
    return;
  }

  final CompatibilityUpdater updater = new CompatibilityUpdater();
  updater.performUpdate( reportRenderContext.getContextRoot() );
}
 
Example 8
/**
 * Demo starting point.
 *
 * @param args ignored.
 */
public static void main(final String[] args)
{
  ClassicEngineBoot.getInstance().start();
  try
  {
    //final StraightToPDF demo =
    new StraightToPlainText(System.getProperty("user.home") + "/OpenSource-Demo.txt");
    System.exit(0);
  }
  catch (Exception e)
  {
    logger.error("Failed to run demo", e);
    System.exit(1);
  }
}
 
Example 9
private void writeConnectionInfo( final ReportWriterContext context,
                                  final XmlWriter xmlWriter,
                                  final DataSourceProvider connectionProvider )
  throws IOException, ReportWriterException {
  final String configKey =
    MondrianDataFactoryModule.DATASOURCE_WRITER_PREFIX + connectionProvider.getClass().getName();
  final Configuration globalConfig = ClassicEngineBoot.getInstance().getGlobalConfig();
  final String value = globalConfig.getConfigProperty( configKey );
  if ( value == null ) {
    throw new ReportWriterException( "Unable to locate writer for " + connectionProvider.getClass().getName() );
  }
  final DataSourceProviderWriteHandler handler = ObjectUtilities.loadAndInstantiate
    ( value, AbstractMDXDataFactoryWriteHandler.class, DataSourceProviderWriteHandler.class );
  if ( handler == null ) {
    throw new ReportWriterException( "Invalid handler for " + connectionProvider.getClass().getName() );
  }
  handler.write( context, xmlWriter, connectionProvider );
}
 
Example 10
public static void main( final String[] args ) {
  ClassicEngineBoot.getInstance().start();
  final ExpressionMetaData[] datas = ExpressionRegistry.getInstance().getAllExpressionMetaDatas();
  Arrays.sort( datas, GroupedMetaDataComparator.ENGLISH );
  for ( int i = 0; i < datas.length; i++ ) {
    final ExpressionMetaData data = datas[ i ];
    if ( data instanceof AbstractMetaData == false ) {
      continue;
    }
    printMetaBundle( data );
  }
}
 
Example 11
protected void setUp() throws Exception {
  ClassicEngineBoot.getInstance().start();

  tester = new PageBreakPositionList();
  tester.addMajorBreak( 0, 0 );
  tester.addMinorBreak( 5000 );
  tester.addMajorBreak( 10000, 0 );
  tester.addMinorBreak( 15000 );
  tester.addMajorBreak( 20000, 0 );
  tester.addMinorBreak( 25000 );
  tester.addMajorBreak( 30000, 0 );
}
 
Example 12
@Override
public void init(
  ServletConfig config) 
  throws ServletException 
{

  super.init(config);
  ClassicEngineBoot.getInstance().start();

}
 
Example 13
@Override
public void init(
  ServletConfig config) 
  throws ServletException 
{

  super.init(config);
  ClassicEngineBoot.getInstance().start();

}
 
Example 14
public String writeReport( final WriteableDocumentBundle bundle, final BundleWriterState state ) throws IOException,
  BundleWriterException {
  if ( state == null ) {
    throw new NullPointerException();
  }
  if ( bundle == null ) {
    throw new NullPointerException();
  }

  final WriteableDocumentMetaData writeableMetaData = bundle.getWriteableDocumentMetaData();
  final String version =
      ClassicEngineInfo.getInstance().getName() + ' ' + ClassicEngineInfo.getInstance().getVersion();

  writeableMetaData.setBundleAttribute( ODFMetaAttributeNames.Meta.NAMESPACE, ODFMetaAttributeNames.Meta.GENERATOR,
      version );

  final Date currentDate = new Date();
  if ( writeableMetaData.getBundleAttribute( ODFMetaAttributeNames.Meta.NAMESPACE,
      ODFMetaAttributeNames.Meta.CREATION_DATE ) == null ) {
    writeableMetaData.setBundleAttribute( ODFMetaAttributeNames.Meta.NAMESPACE,
        ODFMetaAttributeNames.Meta.CREATION_DATE, currentDate );
  }

  writeableMetaData.setBundleAttribute( ODFMetaAttributeNames.DublinCore.NAMESPACE,
      ODFMetaAttributeNames.DublinCore.DATE, currentDate );
  final MasterReport masterReport = state.getMasterReport();
  final Object visibleFlag = masterReport.getAttribute( AttributeNames.Pentaho.NAMESPACE, "visible" );
  if ( Boolean.FALSE.equals( visibleFlag ) ) {
    writeableMetaData.setBundleAttribute( ClassicEngineBoot.METADATA_NAMESPACE, "visible", "false" );
  } else {
    writeableMetaData.setBundleAttribute( ClassicEngineBoot.METADATA_NAMESPACE, "visible", "true" );
  }

  writeVersionMarker( writeableMetaData, masterReport );
  return null;
}
 
Example 15
public boolean initialize( final SwingGuiContext context ) {
  if ( super.initialize( context ) == false ) {
    return false;
  }
  if ( ClassicEngineBoot.getInstance().isModuleAvailable( CSVExportGUIModule.class.getName() ) == false ) {
    return false;
  }
  return true;
}
 
Example 16
@Override
public void init(
  ServletConfig config) 
  throws ServletException 
{

  super.init(config);
  ClassicEngineBoot.getInstance().start();

}
 
Example 17
public static synchronized KettleTransformationProducerReadHandlerFactory getInstance() {
  if ( readHandlerFactory == null ) {
    readHandlerFactory = new KettleTransformationProducerReadHandlerFactory();
    readHandlerFactory.configureGlobal( ClassicEngineBoot.getInstance().getGlobalConfig(), PREFIX_SELECTOR );
  }
  return readHandlerFactory;
}
 
Example 18
/**
 * Writes a data-source into a own file. The name of file inside the bundle is returned as string. The file name
 * returned is always absolute and can be made relative by using the IOUtils of LibBase. If the writer-handler did not
 * generate a file on its own, it should return null.
 *
 * @param bundle      the bundle where to write to.
 * @param dataFactory the data factory that should be written.
 * @param state       the writer state to hold the current processing information.
 * @return the name of the newly generated file or null if no file was created.
 * @throws IOException           if any error occured
 * @throws BundleWriterException if a bundle-management error occured.
 */
public String writeDataFactory( final WriteableDocumentBundle bundle,
                                final DataFactory dataFactory,
                                final BundleWriterState state )
  throws IOException, BundleWriterException {
  final String fileName =
    BundleUtilities.getUniqueName( bundle, state.getFileName(), "datasources/kettle-ds{0}.xml" );
  if ( fileName == null ) {
    throw new IOException( "Unable to generate unique name for Inline-Data-Source" );
  }

  final OutputStream outputStream = bundle.createEntry( fileName, "text/xml" );
  final DefaultTagDescription tagDescription = new DefaultTagDescription
    ( ClassicEngineBoot.getInstance().getGlobalConfig(), KettleDataFactoryModule.TAG_DEF_PREFIX );
  final XmlWriter xmlWriter =
    new XmlWriter( new OutputStreamWriter( outputStream, "UTF-8" ), tagDescription, "  ", "\n" );

  final KettleDataFactory kettleDataFactory = (KettleDataFactory) dataFactory;

  final AttributeList rootAttrs = new AttributeList();
  rootAttrs.addNamespaceDeclaration( "data", KettleDataFactoryModule.NAMESPACE );
  xmlWriter.writeTag( KettleDataFactoryModule.NAMESPACE, "kettle-datasource", rootAttrs, XmlWriter.OPEN );

  final String[] queryNames = kettleDataFactory.getQueryNames();
  for ( int i = 0; i < queryNames.length; i++ ) {
    final String queryName = queryNames[ i ];
    final KettleTransformationProducer prod = kettleDataFactory.getQuery( queryName );
    final TransformationProducerWriteHandler handler = lookupWriteHandler( prod );
    handler.writeKettleRepositoryProducer( bundle, fileName, xmlWriter, queryName, prod );
  }
  xmlWriter.writeCloseTag();
  xmlWriter.close();
  return fileName;
}
 
Example 19
@Before
public void before() throws SAXException {
  ClassicEngineBoot.getInstance().start();
  kettleTransFromRepositoryReadHandler = new KettleTransFromRepositoryReadHandler();
  kettleTransFromRepositoryReadHandler.init( mock( RootXmlReadHandler.class ), "TEST_URI", "TEST_TAG" );

  testAttributes = mock( Attributes.class );
  when( testAttributes.getValue( anyString(), eq( "name" ) ) ).thenReturn( "TEST_NAME" );
  when( testAttributes.getValue( anyString(), eq( "repository" ) ) ).thenReturn( "TEST_REPOSITORY" );
  when( testAttributes.getValue( anyString(), eq( "username" ) ) ).thenReturn( "TEST_USERNAME" );
  when( testAttributes.getValue( anyString(), eq( "password" ) ) ).thenReturn( "TEST_PASSWORD" );
  when( testAttributes.getValue( anyString(), eq( "step" ) ) ).thenReturn( "TEST_STEP" );
}
 
Example 20
public boolean initialize( final SwingGuiContext context ) {
  if ( super.initialize( context ) == false ) {
    return false;
  }
  if ( ClassicEngineBoot.getInstance().isModuleAvailable( HtmlExportGUIModule.class.getName() ) == false ) {
    return false;
  }
  return true;
}
 
Example 21
public static void main(final String[] args) throws Exception
  {
    ClassicEngineBoot.getInstance().start();

    final SparklineAPIDemo demoHandler = new SparklineAPIDemo();
//    BundleWriter.writeReportToZipFile(demoHandler.createReport(), new File("/tmp/sparklines.prpt"));

    final SimpleDemoFrame frame = new SimpleDemoFrame(demoHandler);
    frame.init();
    frame.pack();
    LibSwingUtil.centerFrameOnScreen(frame);
    frame.setVisible(true);
//    HtmlReportUtil.createDirectoryHTML(demoHandler.createReport(), "/tmp/test/report.html");
  }
 
Example 22
public static void main(final String[] args)
{
  ClassicEngineBoot.getInstance().start();

  final SimpleBarcodesODFDemo demoHandler = new SimpleBarcodesODFDemo();
  final SimpleDemoFrame frame = new SimpleDemoFrame(demoHandler);
  frame.init();
  frame.pack();
  LibSwingUtil.centerFrameOnScreen(frame);
  frame.setVisible(true);

}
 
Example 23
public static void main(final String[] args)
{
  ClassicEngineBoot.getInstance().start();

  final BandInBandStackingDemoHandler demoHandler = new BandInBandStackingDemoHandler();
  final SimpleDemoFrame frame = new SimpleDemoFrame(demoHandler);
  frame.init();
  frame.pack();
  LibSwingUtil.centerFrameOnScreen(frame);
  frame.setVisible(true);

}
 
Example 24
/**
 * Initializes the module. Use this method to perform all initial setup operations. This method is called only once in
 * a modules lifetime. If the initializing cannot be completed, throw a ModuleInitializeException to indicate the
 * error,. The module will not be available to the system.
 *
 * @param subSystem
 *          the subSystem.
 * @throws ModuleInitializeException
 *           if an error occurred while initializing the module.
 */
public void initialize( final SubSystem subSystem ) throws ModuleInitializeException {
  final String value =
      ClassicEngineBoot.getInstance().getGlobalConfig().getConfigProperty(
          "org.pentaho.reporting.engine.classic.core.ConfigStore", "<not defined>" );
  if ( value.equals( JAVA14_CONFIG_STORE_CLASS ) == false ) {
    logger.debug( "Java 1.4 Config module not active." );
    return;
  }
  // this will result in an caught exception if JDK 1.4 is not available.
  performExternalInitialize( JAVA14_CONFIG_STORE_INITIALIZER, Java14ConfigModule.class );
}
 
Example 25
public DataSchemaModel getDataSchemaModel() {
  if ( dataSchemaModel == null ) {
    final ContextAwareDataSchemaModelFactory factory =
        ClassicEngineBoot.getInstance().getObjectFactory().get( ContextAwareDataSchemaModelFactory.class );
    dataSchemaModel = factory.create( report );
  }
  return dataSchemaModel;
}
 
Example 26
public static void main( String[] args ) {
  ClassicEngineBoot.getInstance().start();
  final TreeMap globalAttributes = new TreeMap();
  final ElementMetaData[] datas = ElementTypeRegistry.getInstance().getAllElementTypes();
  for ( int i = 0; i < datas.length; i++ ) {
    final ElementMetaData data = datas[ i ];
    if ( data instanceof AbstractMetaData == false ) {
      continue;
    }
    printMetaBundle( data, globalAttributes );
  }
  System.out.println( "-----------------------------------------------------" );

  final Iterator iterator = globalAttributes.entrySet().iterator();
  while ( iterator.hasNext() ) {
    final Map.Entry o = (Map.Entry) iterator.next();

    final AttributeMetaData attribute = (AttributeMetaData) o.getValue();
    final AbstractMetaData aamd = (AbstractMetaData) attribute;
    final String akeyPrefix = aamd.getKeyPrefix();
    final String abundle = aamd.getBundleLocation();
    final String aname = attribute.getName();

    System.out.println( akeyPrefix + aname + ".display-name=" + aname );
    System.out.println( akeyPrefix + aname + ".grouping=" + filter( aamd.getGrouping( Locale.ENGLISH ), "Group" ) );
    System.out.println( akeyPrefix + aname + ".description=" + filter( aamd.getDescription( Locale.ENGLISH ), "" ) );
    System.out
      .println( akeyPrefix + aname + ".deprecated=" + filter( aamd.getDeprecationMessage( Locale.ENGLISH ), "" ) );
  }
}
 
Example 27
/**
   * Entry point for running the demo application...
   *
   * @param args ignored.
   */
  public static void main(final String[] args)
      throws ReportProcessingException,
      IOException, ReportDefinitionException, ContentIOException, BundleWriterException
  {
    // initialize JFreeReport
    ClassicEngineBoot.getInstance().start();

    final TrafficLightingDemo handler = new TrafficLightingDemo();
    final MasterReport report = handler.createReport();
//
//    try
//    {
//      final File file = new File("/tmp/report-out");
//      file.mkdirs();
//      BundleWriter.writeReportToDirectory(report, file);
//    }
//    catch (Exception e)
//    {
//      // ignore
//    }

    final SimpleDemoFrame frame = new SimpleDemoFrame(handler);
    frame.init();
    frame.pack();
    LibSwingUtil.centerFrameOnScreen(frame);
    frame.setVisible(true);
//    PdfReportUtil.createPDF(report, new NullOutputStream());
    //HtmlReportUtil.createStreamHTML(handler.createReport(), "/tmp/groups.html");
//    ExcelReportUtil.createXLS(handler.createReport(), "/tmp/groups.xls");
  }
 
Example 28
public static void main(String[] args)
{
  // initialize JFreeReport
  ClassicEngineBoot.getInstance().start();

  final RectanglesDemo handler = new RectanglesDemo();
  final SimpleDemoFrame frame = new SimpleDemoFrame(handler);
  frame.init();
  frame.pack();
  LibSwingUtil.centerFrameOnScreen(frame);
  frame.setVisible(true);

}
 
Example 29
@Test
public void testInitialize() throws Exception {
  ClassicEngineBoot.getInstance().start();
  RhinoModule module = new RhinoModule();
  module.initialize( null );

  assertThat( module.getDescription(), is( equalTo( "test rhino description" ) ) );
  assertThat( module.getMajorVersion(), is( equalTo( "1" ) ) );
  assertThat( module.getMinorVersion(), is( equalTo( "1" ) ) );
  assertThat( module.getPatchLevel(), is( equalTo( "0" ) ) );
  assertThat( module.getName(), is( equalTo( "test-rhino-module-name" ) ) );
  assertThat( module.getProducer(), is( equalTo( "test rhino producer" ) ) );

  ModuleInfo[] requiredModules = module.getRequiredModules();
  assertThat( requiredModules.length, is( equalTo( 1 ) ) );
  ModuleInfo requiredModule = requiredModules[0];
  assertThat( requiredModule.getModuleClass(), is( equalTo( "test.required.module.class" ) ) );
  assertThat( requiredModule.getMinorVersion(), is( equalTo( "2" ) ) );
  assertThat( requiredModule.getMajorVersion(), is( equalTo( "2" ) ) );
  assertThat( requiredModule.getPatchLevel(), is( equalTo( "1" ) ) );

  ModuleInfo[] optionalModules = module.getOptionalModules();
  assertThat( optionalModules.length, is( equalTo( 1 ) ) );
  ModuleInfo optionalModule = optionalModules[0];
  assertThat( optionalModule.getModuleClass(), is( equalTo( "test.optional.module.class" ) ) );
  assertThat( optionalModule.getMinorVersion(), is( equalTo( "1" ) ) );
  assertThat( optionalModule.getMajorVersion(), is( equalTo( "1" ) ) );
  assertThat( optionalModule.getPatchLevel(), is( equalTo( "0" ) ) );

  assertThat( ExpressionRegistry.getInstance().isExpressionRegistered( EXPRESSION_ID ), is( equalTo( true ) ) );
  ExpressionMetaData meta = ExpressionRegistry.getInstance().getExpressionMetaData( EXPRESSION_ID );
  assertThat( meta.getBundleLocation(),
      is( equalTo( "org.pentaho.reporting.engine.classic.extensions.modules.rhino.RhinoExpressionBundle" ) ) );
  assertThat( meta.getPropertyDescription( "expression" ), is( notNullValue() ) );
}
 
Example 30
/**
 * Entry point for running the demo application...
 *
 * @param args ignored.
 */
public static void main(final String[] args)
{
  // initialize JFreeReport
  ClassicEngineBoot.getInstance().start();

  final ReportFooterDemo handler = new ReportFooterDemo();
  final SimpleDemoFrame frame = new SimpleDemoFrame(handler);
  frame.init();
  frame.pack();
  LibSwingUtil.centerFrameOnScreen(frame);
  frame.setVisible(true);
}