I tried running the samples by downloading them which is provided in InfoCenter under the section
'Embedding the Reporting Engine into a Java applocation'.

I could execute a report (.prpt file) which is developed in Report Designer from within
a java application to generate the output file which is what Sample1 does.

But I couldn't find success in executing an interactive report (.prpti file) from within a java application.

Here is the exception stack trace I have been getting :

org.pentaho.reporting.libraries.resourceloader.ResourceCreationException: Unable to parse the document: ResourceKey{schema=org.pentaho.reporting.libraries.resourceloader.loader.URLResourceLoader, identifier=file:/D:/eclipse-workspace-new-2/samples/eclipse-bin/org/pentaho/reporting/engine/classic/samples/ordersales%20analyzer%20report.xanalyzer, factoryParameters={}, parent=null}
at org.pentaho.reporting.libraries.xmlns.parser.AbstractXmlResourceFactory.create(AbstractXmlResourceFactory.java:250)
at org.pentaho.reporting.libraries.resourceloader.DefaultResourceManagerBackend.create(DefaultResourceManagerBackend.java:270)
at org.pentaho.reporting.libraries.resourceloader.ResourceManager.create(ResourceManager.java:442)
at org.pentaho.reporting.libraries.resourceloader.ResourceManager.create(ResourceManager.java:378)
at org.pentaho.reporting.libraries.resourceloader.ResourceManager.createDirectly(ResourceManager.java:214)
at org.pentaho.reporting.engine.classic.samples.Sample12.getReportDefinition(Sample12.java:67)
at org.pentaho.reporting.engine.classic.samples.AbstractReportGenerator.generateReport(AbstractReportGenerator.java:160)
at org.pentaho.reporting.engine.classic.samples.AbstractReportGenerator.generateReport(AbstractReportGenerator.java:128)
at org.pentaho.reporting.engine.classic.samples.Sample12.main(Sample12.java:126)
Caused by: org.pentaho.reporting.libraries.xmlns.parser.NoRootHandlerException: No suitable root handler known for this document: XmlDocumentInfo={rootElementTag=reportRecord, rootElementNS=http://www.pentaho.com, SystemDTD-ID=null, PublicDTD-ID=null, defaultnamespace=http://www.pentaho.com} [Location: Line=-1 Column=-1]
at org.pentaho.reporting.libraries.xmlns.parser.MultiplexRootElementHandler.interceptFirstStartElement(MultiplexRootElementHandler.java:217)
at org.pentaho.reporting.libraries.xmlns.parser.RootXmlReadHandler.startElement(RootXmlReadHandler.java:430)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:501)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:400)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDriver.scanRootElementHook(XMLNSDocumentScannerImpl.java:626)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:3103)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:922)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
at org.pentaho.reporting.libraries.xmlns.parser.AbstractXmlResourceFactory.create(AbstractXmlResourceFactory.java:237)

I checked in the infocenter and in Pentaho forums whether it is possible to execute a .prpti file from within a java application,
But couldn't find the answer. Only it says that a .prpt file can be executed.
Is there a way to execute .prpti file from within a java application for generating the output just likes with .prpt file?

Thanks and regards,
Raman Kumar.

Taqua

04-06-2014, 05:54 AM

Most likely, your classpath is incomplete. Use the SDK to get a sample module that includes a full classpath ( https://github.com/tmorgner/pentaho-reporting-oem-sdk/tree/master/sample-use-full ).

At that point, you will be able to simply point the code in this particular sample to your prpti file, and it will run.