Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: re[birt-report-engine-dev] source folder

My solution to this was to use an IResourceLocator when opening the report
design, something like this:

	design = engine.openReportDesign(file.getAbsolutePath(), inputStream, new
IResourceLocator() {
	    public URL findResource(ModuleHandle moduleHandle, String name, int
type) {
		File f = new File(resourceFiles.getParentFile(), name);
		if ( f.exists() ) {
		    try {
			return f.toURL();
		    } catch (MalformedURLException muex) {
			return null;
		    }
		}
		f = new File(name);
		if ( f.exists() ) {
		    try {
			return f.toURL();
		    } catch (MalformedURLException muex) {
			return null;
		    }
		}
		return null;
	    }
	});

Not sure if the second "new File(name)" is required (or secure), but this
works for me.

Shaun


arnaudcz wrote:
> 
> Does anyone know how to configure the resource folder for the Report
> Engine?
> 

-- 
View this message in context: http://www.nabble.com/resource-folder-tp24714137p24729956.html
Sent from the Eclipse BIRT - Report Engine - Dev mailing list archive at Nabble.com.



Back to the top