Jump to content
We've recently updated our Privacy Statement, available here ×

How to add properties files for internationalization


diddy

Recommended Posts

 Hi,

I currently have my properties files for my report in the same folder as the jrxml file. When I try to add the resource bundle, JasperStudio uses the relative path (and not just the filename as iReport does). When I then click preview, I get an error message saying that the file could not be found. Exactly the same report works perfectly in iReport when using just the filename without the extension. Does someone know how to get this working in JasperStudio?

Thanks,

Diethard

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

 ... ok I got it working. If somebody has to same problem, here is how to solve it:

(1) Make sure your report is within a Java Project folder and contains a src folder.

(2) Put your properties files within this src folder if you already created them elsewhere. Otherwise, right click on the src folder and choose to add a new file. This file has to have the extension .properties. You can open the file then with the build-in text editor and create the key value pairs.

(3) Choose the root element of your report. In the properties dialog go to Advanced > Misc, expand Main Query, then for Resource Bundle choose the properties file. Note: In the current version of JasperStudio, the relative path will be inserted. This is wrong.

(4) Time to fix this: Save the report. Close it. Right click on the report file, choose Open with > Text editor. Look/Search for the resource bundle reference and replace the relative path with just the filename (and NO file extension). 

Now everything will work.

 

 

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...