Hitachi Vantara Pentaho Community Forums
Results 1 to 1 of 1

Thread: Question about embedding Pentaho in a Java app

  1. #1
    Join Date
    Nov 2015
    Posts
    2

    Default Question about embedding Pentaho in a Java app

    Hi,
    I have a custom .prpt (let's call it custom.prpt) and it works fine; however, my team is looking for a way to run the report automatically.
    I am new to Pentaho and am looking for a way to achieve this.
    I did some research and was able to get "org.pentaho.reporting.engine.classic.samples.Sample1.java" to work.
    However, when I replaced "Sample1.prpt" with "custom.prpt" in "Sample1.java" (see the method below), I got errors left and right and "custom.prpt" is in the same directory as "Sample1.prpt". Am I even on the right track? I am sure there is more work to be done in order to make this work; however, I am not sure how to solve this problem.

    public MasterReport getReportDefinition()
    {
    try
    {
    // Using the classloader, get the URL to the reportDefinition file
    final ClassLoader classloader = this.getClass().getClassLoader();
    final URL reportDefinitionURL = classloader.getResource("org/pentaho/reporting/engine/classic/samples/Sample1.prpt");


    // Parse the report file
    final ResourceManager resourceManager = new ResourceManager();
    final Resource directly = resourceManager.createDirectly(reportDefinitionURL, MasterReport.class);
    return (MasterReport) directly.getResource();
    }
    catch (ResourceException e)
    {
    e.printStackTrace();
    }
    return null;
    }

    please advise,

    Neil
    Last edited by NWGesto; 11-09-2015 at 12:46 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.