Home
Analytics
Static Text & Dynamic Text
mg81
I have requirement in my report where I need to display something like this:
"Static Text <Dyanmic Text>"
I can use a text element or data element for this but how can I have the static text localized. One way is to keep the static text as label & dynamic part as text or data element. Is there a better way exists?
This becomes even more challenging when based on locale the sentence changes. For example:
In English: "Static Text <Dyanmic Text>"
In say French: "StaticText1 <Dyanmic Text> StaticText2"
Is there a way to achieve this?
Find more posts tagged with
Comments
JasonW
Have you tried using a text element with something like:
"Static Text "<VALUE-OF>reportContext.getMessage("text1");</VALUE-OF>
That will use the reports current locale. You can also set the specific locale
<value-of>
importPackage(Packages.java.util);
var lc = new Locale("de_DE");
reportContext.getMessage("text1", lc);
</value-of>
Jason
mg81
Thanks Jason...it works.