user1356517
user1356517

Reputation: 61

JasperServer: using user locale in query for input control

I am looking for a way to use the current user locale information in a sql query for the input control in JasperServer.

More details: The input query should present a list of values which it obtains via sql query from our database. However, this values depends on the user locale information. Within the report I can use $P{REPORT_LOCALE} to get the user locale. However, this parameters does not work in the queries used to populate the input controls.

I appreciate every hint.

Upvotes: 3

Views: 2198

Answers (1)

user1356517
user1356517

Reputation: 61

I actually figured it out how to do it.

My solution: create an invisible input control of type string and assign it to the report. Define a report parameter with the same name and set the default value expression to $P{REPORT_LOCALE}.getLanguage(). By doing that I am able to use the language code of the current user via the input parameter in sql queries.

Upvotes: 3

Related Questions