under ireport no problem to use the properties.
but under java and jasperreport it does not find me the file properties
error:
“Can't find bundle for base name liste_anniversaire, locale fr_CH"
my files .jasper and .properties are in the same file
thank you in advance
3 Answers:
Hi,
I am facing the same issue described above, i can get it to work from iReport but when i try to do the same at runtime from the web application i get that "Can't find bundle for base name..." error
The .properties files are in the same location as the .jrxml
I am setting the locale by passing the REPORT_LOCALE parameter, i tried by passing the resource bundle directly without any luck.
i also tried by setting the report classpath pointing to the source folder.
I'm completly lost in this point.
Can anybody help me.
Thanks in advance.
Zeva.
The Web Application is looking for the ResourceBundle in it's CLASSPATH;
The CLASSPATH of a WebApplication is relative to the WEB-INF folder. So you may try to place your properties file(s) in the WEB-INF folder.
Or you could pass a custom classloader to the JasperFillManager. You can do this from any Java Application (not necessarily a web application).This way it doesn't matter where you keep your properties files as long as you let the fill manager know where to look for them on disk.
Hope that helps
Code: |
URL[] url = {new File("D:/propertiesFolder/").toURL()}; URLClassLoader loader = new URLClassLoader(url); params.put("REPORT_CLASS_LOADER",loader); JasperPrint print = JasperFillManager.fillReport(is,params,connection); </td></tr></tbody></table> |