Package org.pentaho.reporting.engine.classic.core.modules.parser.base

Examples of org.pentaho.reporting.engine.classic.core.modules.parser.base.ReportGenerator


   * @throws ParseException if the report could not be parsed.
   */
  private MasterReport parseReport(final URL templateURL)
      throws ParseException
  {
    final ReportGenerator generator = ReportGenerator.getInstance();
    try
    {
      return generator.parseReport(templateURL);
    }
    catch (Exception e)
    {
      throw new ParseException("Failed to parse the report", e);
    }
View Full Code Here


   * @throws ParseException if the report could not be parsed.
   */
  private MasterReport parseReport(final URL templateURL)
      throws ParseException
  {
    final ReportGenerator generator = ReportGenerator.getInstance();
    try
    {
      final MasterReport report = generator.parseReport(templateURL);
      // this demo adds the image at runtime just to show how this could be
      // done. Usually such images get referenced from the XML itself without
      // using manual coding.
      final URL imageURL = ObjectUtilities.getResource
          ("org/pentaho/reporting/engine/classic/demo/opensource/gorilla.jpg", StraightToPNG.class);
View Full Code Here

   * @throws ParseException if the report could not be parsed.
   */
  private MasterReport parseReport(final URL templateURL)
      throws ParseException
  {
    final ReportGenerator generator = ReportGenerator.getInstance();
    try
    {
      final MasterReport report = generator.parseReport(templateURL);
      final URL imageURL = ObjectUtilities.getResource
          ("org/pentaho/reporting/engine/classic/demo/opensource/gorilla.jpg", StraightToPDF.class);
      final Image image = Toolkit.getDefaultToolkit().createImage(imageURL);
      final WaitingImageObserver obs = new WaitingImageObserver(image);
      obs.waitImageLoaded();
View Full Code Here

  public MasterReport createReport() throws ReportDefinitionException
  {
    // create a private instance of the parser so that we can safely modify
    // the configuration..
    final ReportGenerator generator = ReportGenerator.createInstance();
    generator.setObject("outer-header-color", "red");

    final URL in = getReportDefinitionSource();
    if (in == null)
    {
      throw new ReportDefinitionException("URL is invalid");
    }
    try
    {
      MasterReport report = generator.parseReport(in);
      final StyleSheetCollection styleCollection =
          report.getStyleSheetCollection();
      final ElementStyleSheet styleSheet =
          styleCollection.createStyleSheet("my-style");
      styleSheet.setStyleProperty(TextStyleKeys.FONT, "SansSerif");
View Full Code Here

    if (in == null)
    {
      logger.error("xml file not found.");
      return null;
    }
    final ReportGenerator gen = ReportGenerator.getInstance();
    final MasterReport report1;
    try
    {
      report1 = gen.parseReport(in, in);
    }
    catch (Exception ioe)
    {
      logger.error("1: report definition failure.", ioe);
      return null;
View Full Code Here

        dispose();
    }

    protected static final MasterReport parseReport(File reportFile) throws Exception {
      try {
        final ReportGenerator generator = ReportGenerator.getInstance();
        return generator.parseReport(reportFile.toURL());
      } catch (Exception e) {
        throw new ParseException("Failed to parse the report", e); //$NON-NLS-1$
      }
    }
View Full Code Here

  private MasterReport parseReport(final URL templateURL)
      throws IOException
  {
    try
    {
      final ReportGenerator generator = ReportGenerator.getInstance();
      return generator.parseReport(templateURL);
    }
    catch (Exception e)
    {
      ReportConverter.logger.info("ParseReport failed; Cause: ", e);
      throw new IOException("Failed to parse the report");
View Full Code Here

   * @param args ignored.
   */
  public static void main(final String[] args)
  {
    ClassicEngineBoot.getInstance().start();
    final ReportGenerator gen = ReportGenerator.getInstance();
    final URL reportURL = ObjectUtilities.getResourceRelative
        (REFERENCE_REPORT, StyleKeyReferenceGenerator.class);
    if (reportURL == null)
    {
      System.err.println("The report was not found in the classpath"); //$NON-NLS-1$
      System.err.println("File: " + REFERENCE_REPORT); //$NON-NLS-1$
      System.exit(1);
      return;
    }

    final MasterReport report;
    try
    {
      report = gen.parseReport(reportURL);
    }
    catch (Exception e)
    {
      System.err.println("The report could not be parsed."); //$NON-NLS-1$
      System.err.println("File: " + REFERENCE_REPORT); //$NON-NLS-1$
View Full Code Here

   * @param args ignored.
   */
  public static void main(final String[] args)
  {
    ClassicEngineBoot.getInstance().start();
    final ReportGenerator gen = ReportGenerator.getInstance();
    final URL reportURL = ObjectUtilities.getResourceRelative
        (REFERENCE_REPORT, ObjectReferenceGenerator.class);
    if (reportURL == null)
    {
      System.err.println("The report was not found in the classpath"); //$NON-NLS-1$
      System.err.println("File: " + REFERENCE_REPORT); //$NON-NLS-1$
      System.exit(1);
      return;
    }

    final MasterReport report;
    try
    {
      report = gen.parseReport(reportURL);
    }
    catch (Exception e)
    {
      System.err.println("The report could not be parsed."); //$NON-NLS-1$
      System.err.println("File: " + REFERENCE_REPORT); //$NON-NLS-1$
View Full Code Here

   * @param args ignored.
   */
  public static void main(final String[] args)
  {
    ClassicEngineBoot.getInstance().start();
    final ReportGenerator gen = ReportGenerator.getInstance();
    final URL reportURL = ObjectUtilities.getResourceRelative
        (REFERENCE_REPORT, DataSourceReferenceGenerator.class);
    if (reportURL == null)
    {
      System.err.println("The report was not found in the classpath"); //$NON-NLS-1$
      System.err.println("File: " + REFERENCE_REPORT); //$NON-NLS-1$
      System.exit(1);
      return;
    }

    final MasterReport report;
    try
    {
      report = gen.parseReport(reportURL);
    }
    catch (Exception e)
    {
      System.err.println("The report could not be parsed."); //$NON-NLS-1$
      System.err.println("File: " + REFERENCE_REPORT); //$NON-NLS-1$
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.engine.classic.core.modules.parser.base.ReportGenerator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.