resource file usage [message #728712] |
Fri, 23 September 2011 14:11  |
Eclipse User |
|
|
|
I can't seem to find anything on the usage of resource files (properties files, specifically) for use in scripts and data source binding (other than profiles or localization). Is it possible to do this? I need to use values from properties files for both datasource binding but also other context-specific values, such as external filepaths. One way I found to get properties is using reportContext.getMessage("foo"), however this assumes there is a default localization, which doesn't apply to the types of properties I'm trying to use. Is there another way to get values from a properties file, or perhaps turn localization off so that it will not look for the file with locale appended?
|
|
|
Re: resource file usage [message #728727 is a reply to message #728712] |
Fri, 23 September 2011 14:55  |
Eclipse User |
|
|
|
If your file is in the resource folder just use
reportContext.getResource("yourfile"); This will return a path to the
file which you should be able to open and read. I used it once to get
an image from a jar file like:
var jarfile = reportContext.getResource("myimages.jar");
fulljarimage = "jar:"+jarfile.toString()+"!/BIRT1_2ndEd_frontsmall.jpg";
Jason
On 9/23/2011 2:11 PM, john.libby wrote:
> I can't seem to find anything on the usage of resource files (properties
> files, specifically) for use in scripts and data source binding (other
> than profiles or localization). Is it possible to do this? I need to use
> values from properties files for both datasource binding but also other
> context-specific values, such as external filepaths. One way I found to
> get properties is using reportContext.getMessage("foo"), however this
> assumes there is a default localization, which doesn't apply to the
> types of properties I'm trying to use. Is there another way to get
> values from a properties file, or perhaps turn localization off so that
> it will not look for the file with locale appended?
|
|
|
Powered by
FUDForum. Page generated in 0.07653 seconds