Jump to content

Display report output text using a msg file ref.


angeez

Recommended Posts

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 = Address
title_co=Company

I 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

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

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

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