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 ) );
}