Examples of ReportGenerator


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

        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

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

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

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

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

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

     */
    private MasterReport loadMasterReport(InputStream input) throws ReportException {
        try {
            rmgr.registerDefaults();
            // TODO Figure out a non-deprecated way to load a report from InputStream
            final ReportGenerator generator = ReportGenerator.createInstance();
            final InputSource repDefInputSource = new InputSource(input);
            return generator.parseReport(repDefInputSource, null);
        } catch (Exception ex) {
            throw new ReportException("Unable to load report", ex);
        }
    }
View Full Code Here

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

      resource = getResource( ( (ActionResource) reportDefinition ).getName() );
    }
    if ( resource != null ) {
      if ( resource.getSourceType() == IActionResource.XML ) {
        String repDef = resource.getAddress();
        ReportGenerator generator = ReportGenerator.createInstance();

        // add the runtime context so that PentahoResourceData class can get access to the solution repo
        // generator.setObject(PentahoResourceData.PENTAHO_RUNTIME_CONTEXT_KEY, getRuntimeContext());

        // Read the encoding from the XML file - see BISERVER-895
        final String encoding = XmlHelper.getEncoding( repDef, null );
        ByteArrayInputStream inStream = new ByteArrayInputStream( repDef.getBytes( encoding ) );
        InputSource repDefInputSource = new InputSource( inStream );
        repDefInputSource.setEncoding( encoding );
        report = generator.parseReport( repDefInputSource, getDefinedResourceURL( null ) );
      } else {
        report = parseReport( resource );
      }
    }
    return report;
View Full Code Here

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

    return report;
  }

  protected MasterReport createReport( final String reportDefinition ) throws ResourceException, IOException {
    ReportGenerator generator = ReportGenerator.createInstance();

    // add the runtime context so that PentahoResourceData class can get access to the solution repo
    // generator.setObject(PentahoResourceData.PENTAHO_RUNTIME_CONTEXT_KEY, getRuntimeContext());

    URL url = null;
    IPentahoRequestContext requestContext = PentahoRequestContextHolder.getRequestContext();
    try {
      url = new URL( requestContext.getContextPath() ); //$NON-NLS-1$ //$NON-NLS-2$
    } catch ( Exception e ) {
      // a null URL is ok
      warn( Messages.getInstance().getString( "JFreeReportLoadComponent.WARN_COULD_NOT_CREATE_URL" ) ); //$NON-NLS-1$
    }

    // Read the encoding from the XML file - see BISERVER-895
    final String encoding = XmlHelper.getEncoding( reportDefinition, null );
    ByteArrayInputStream inStream = new ByteArrayInputStream( reportDefinition.getBytes( encoding ) );
    InputSource reportDefinitionInputSource = new InputSource( inStream );
    reportDefinitionInputSource.setEncoding( encoding );
    return generator.parseReport( reportDefinitionInputSource, getDefinedResourceURL( url ) );
  }
View Full Code Here

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

      throw new Exception( Messages.getInstance().getErrorString( "JFreeReport.ERROR_0016_REPORT_RESOURCE_INVALID", //$NON-NLS-1$
          reportLocation, resource.getAddress() ) );
    }

    try {
      ReportGenerator generator = ReportGenerator.getInstance();

      // add the runtime context so that PentahoResourceData class can get access to the solution repo
      // generator.setObject(PentahoResourceData.PENTAHO_RUNTIME_CONTEXT_KEY, getRuntimeContext());

      report = generator.parseReport( resourceUrl, getDefinedResourceURL( resourceUrl ) );
    } catch ( Exception ex ) {
      throw new Exception( Messages.getInstance().getErrorString(
          "JFreeReport.ERROR_0007_COULD_NOT_PARSE", reportLocation ), ex ); //$NON-NLS-1$
    }
    return report;
View Full Code Here

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

      final IActionSequenceResource resource = getResource(
        AbstractJFreeReportComponent.REPORTGENERATEDEFN_REPORTDEFN );

      if ( resource.getSourceType() == IActionResource.XML ) {
        String repDef = resource.getAddress();
        ReportGenerator generator = ReportGenerator.getInstance();

        report =
            generator.parseReport( new InputSource( new ByteArrayInputStream( repDef.getBytes() ) ),
                getDefinedResourceURL( null ) );
      }
      report = parseReport( resource );
    } else if ( isDefinedInput( AbstractJFreeReportComponent.REPORTLOAD_RESOURCENAME ) ) {
      final String resName = getInputStringValue( AbstractJFreeReportComponent.REPORTLOAD_RESOURCENAME );
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.