Difference between revisions of "Finding resources in JasperReports"

From iDempiere en
Line 17: Line 17:
  
 
= Resource bundles in subreports =
 
= 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:
 +
 +
[[File:ResourceBundleInSubreport.png]]
  
 
[[Category:JasperReports]]
 
[[Category:JasperReports]]

Revision as of 20:54, 6 September 2013

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.

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:

ResourceBundleInSubreport.png

Cookies help us deliver our services. By using our services, you agree to our use of cookies.