Here is my Input Control:
Note that the Info in the "Course Group" (Single Select Query) is in English
Here is the Query that gets the data in "Course Group"
select distinct(cog.cog_id) id, concat(cd.cd_shortdescription, '
(', cn.cn_shortname,' - ', cog.cog_org_be_id, ' - ', cd_code.cd_code, ')')
coursegroup
from es_exam_statistics_ft es, cg_classgroup cg, org_organisation org,
cn_campusname cn, cog_coursegroup cog, cd_codedescription cd, cd_code
where es.es_cg_id = cg.cg_id
and es.es_cog_id = cog.cog_id
and cog.cog_coursegroup_cd_id = cd.cd_id
and cd.cd_id = cd_code.cd_id
and org.org_be_id = cog.cog_org_be_id
and org.org_campusid = cn.cn_campusid
and cg.cg_startdate >= $P{startDate}
and cg.cg_enddate <= $P{endDate}
and cd.cd_language_id = 3
and cn.cn_language_id = 3
order by coursegroup
The problem comes with the lines i have made bold Language Id's
2=Afrikaans
3=English
Now as you can see, the Query is hard-coded so that the language is always English, So if a user logs in, in a different language, the data in the input control will always be English
I tried replacing the value 3 form query (and cd.cd_language_id = 3
) with "$P{REPORT_LOCALE}.getDisplayLanguage().equals("English") ? new Integer(3): new Integer(2)"
Which works in the XML of a Report, but doesn't work in the input Controls Query
How do I solve this issue ?