angeez Posted October 28, 2009 Share Posted October 28, 2009 I have a list of text in a message file (MsgRes). A sample of my msg file content would be.title_name = Name title_addr = Addresstitle_co=CompanyI need to render my reports heading via a 'call' to this message file. For example, in one of my report column, i would put something like res.getString(title_name) and it will then render "Name" in my report output.There could be a function that's something like cl = java.lang.Thread.currentThread().getContextClassLoader(); res = java.util.ResourceBundle.getBundle("MsgRes",us,cl); How do I do this? Link to comment Share on other sites More sharing options...
mdahlman Posted October 28, 2009 Share Posted October 28, 2009 angeez,You should be able to put the .properties file in the classpath, define the resource bundle as a report property, and then in the report you can use this in a text field:$R{title_name}It will retrieve "Name" and display that. (You'll also be all set if you later want to add MsgRes_fr.properties and then run the report in French.)There are more detailed steps, screenshots, etc in the iReport Ultimate Guide.Regards,Matt Link to comment Share on other sites More sharing options...
angeez Posted October 30, 2009 Author Share Posted October 30, 2009 hi mdahlman,I'm very new to ireport.. How do i do the following to "link" my report to the .properties file?1. put the .properties file in the classpath2. define the resource bundle as a report property? Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now