Examples of ReportGenerator


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

   * @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

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

  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

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
    {
      final MasterReport report = generator.parseReport(templateURL);
      // plain text does not support images, so we do not care about the logo ..
      report.getParameterValues().put("logo", null);
      return report;
    }
    catch (Exception e)
View Full Code Here

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

  }


  protected void previewReport(final JInternalFrame frame)
  {
    final ReportGenerator generator = ReportGenerator.getInstance();
    try
    {
      final URL in = ObjectUtilities.getResourceRelative
          ("component-drawing.xml", ComponentDrawingDemoHandler.class);
      if (in == null)
      {
        return;
      }
      final MasterReport report = generator.parseReport(in);
      report.getReportConfiguration().setConfigProperty
          ("org.pentaho.reporting.engine.classic.core.AllowOwnPeerForComponentDrawable", "true");
      final PaintComponentTableModel tableModel = new PaintComponentTableModel();
      tableModel.addComponent(frame);
      report.setDataFactory(new TableDataFactory("default", tableModel));
View Full Code Here

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

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

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
    {
      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

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
    {
      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

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

  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

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

    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
TOP
Copyright © 2018 www.massapi.com. 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.