For example I have such strings in ResourceBundle:
some.string.1=String 1
some.string.2=String 2
some.string.3=String 3
In JasperReports I have to print these strings based on some other parameter $P{t}.
I can do it this way – put such expression into field:
($P{t} == 1 ? $R{some.string.1} : ($P{t} == 2 ? $R{some.string.2} : $R{some.string.3}))
Is there any way to implement it that way:
$R{some.string.$P{t}}
?
Thank you
Use this:
I have used similar things… though I don’t remember using exactly this. It ought to work for what you’re describing.