Difference between revisions of "Finding resources in JasperReports"
| (3 intermediate revisions by 2 users not shown) | |||
| Line 27: | Line 27: | ||
[[File:ResourceBundleInSubreport.png]] | [[File:ResourceBundleInSubreport.png]] | ||
| − | [[Category:JasperReports]] | + | [[Category: HowTo-Technical|J]] |
| + | [[Category: JasperReports]] | ||
| + | [[Category: Issue (print)]] | ||
| + | [[Category: Development|P]] | ||
| + | [[Category: Developer documentation]] | ||
| + | [[Category: HowTo]] | ||
| + | [[Category: NeedsToBeUpdated]] | ||
Latest revision as of 22:23, 1 July 2022
Images
Resources such as images that are attachments can be referenced using $P{RESOURCE_DIR}.
An image path would look like
$P{RESOURCE_DIR} + "image.jpg"
Resource bundles
Resource bundles are property files for translating reports into different languages.
By default iDempiere-JasperReports looks for a resource file with the same name as the JasperFile, ie, the Jasperfile is called Report.jasper and then it will look for Report.properties and Report_en_US.properties etc. This might be practical if you only have one single report and have no need to share translations between different reports.
When https://idempiere.atlassian.net/browse/IDEMPIERE-1215 has been resolved you can also specify a custom name on the Resource Bundle. This enables you to share resource bundles between reports.
NOTE! iDempiere doesn't handle resource bundles with country specific languange until after IDEMPIERE-1215 have been resolved.
Resource bundles in subreports
Currently iDempiere doesn't support resource bundles in subreports when the resource bundle is defined in the subreport. However, if you have a resource bundle in the main report you can pass that resource bundle to the subreport like this:

