andre.erasmus Posted March 19, 2013 Share Posted March 19, 2013 Ok so here is my Input ControlNote that the Info in the "Course Group" (Single Select Query) is in EnglishHere 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, ')') coursegroupfrom es_exam_statistics_ft es, cg_classgroup cg, org_organisation org, cn_campusname cn, cog_coursegroup cog, cd_codedescription cd, cd_codewhere es.es_cg_id = cg.cg_idand es.es_cog_id = cog.cog_idand cog.cog_coursegroup_cd_id = cd.cd_idand cd.cd_id = cd_code.cd_idand org.org_be_id = cog.cog_org_be_idand org.org_campusid = cn.cn_campusidand cg.cg_startdate >= $P{startDate} and cg.cg_enddate = $P{endDate}and cd.cd_language_id = 3and cn.cn_language_id = 3order by coursegroupThe problem comes with the lines i have Highlighted RedLanguage Id's2 = Afrikaans3 =EnglishNow as you can see, the Query is hardcoded 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 EnglishI tried replacing the 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 QueryHow do I solve this Issue ? Link to comment Share on other sites More sharing options...
Srikanth Kattam Posted May 10, 2013 Share Posted May 10, 2013 Hi Andre, Here a resolution for your issue: Create a parameter say locale in ireport and its default value expression as $P{REPORT_LOCALE}.getDisplayLanguage().equals("English") ? new Integer(3): new Integer(2), now use this parameter $P{locale} within the where clause of query. Now to make this work in Course Group input control: Create a single value input control (visible=false)with its ID as locale. Now use this parameter $P{locale} within the where clause of Course Group input control query. Tested and its working. Regards, Srikanth Kattam Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now