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

Evaluating Expression inside a String


honza.brtek

Recommended Posts

Hi all, I am having the following problem. In the detail band I get a very specific field from the database which requires further processing. So I call a Java method inside a textField to process this requirement.
content of the textfield: ReportUtils.testMethod($F{FIELD_FOR_PROCESSING})
Sadly, part of the returned String has to be a resource bundle reference. When I return "$R{id}" just to test the functionality, reference is not replaced.
printed output: $R{id}
wanted output: ID (taken from the resource bundle)

jasperissue.png.510c6def679eb3d16c5d15951b5545b5.png
I have few ideas for a workaround but none of them is "nice". Do you have any suggestions on how to solve it, please?
Thank you in advance, Jan

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

I am working with a Java application to create PDF.
In my application,
I use i18n as ResourceBundle to get the text base on Locale.

And in my method, I return a string from i18n bundle resource I want.

java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("localization/i18n", Locale.JAPAN);return bundle.getString("id");[/code]

Hope this can help you.

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...