nimal Posted September 21, 2010 Share Posted September 21, 2010 Hi, I have to prepare a report (with iReport 3.7.3) within the user can choose the visuables fields himself.I tried something like this : SELECTDISTINCT (m.name || ' ' || m.name2) AS Nom, CASE WHEN 'gsm' = $P{VAR_Field_0} THEN m.GSM_TIERS END AS Field_0, CASE WHEN 'gsm' = $P{VAR_Field_1} THEN m.GSM_TIERS END AS Field_1, CASE WHEN 'gsm' = $P{VAR_Field_2} THEN m.GSM_TIERS END AS Field_2, CASE WHEN 'gsm' = $P{VAR_Field_3} THEN m.GSM_TIERS END AS Field_3, CASE WHEN 'gsm' = $P{VAR_Field_4} THEN m.GSM_TIERS END AS Field_4, CASE WHEN 'branche' = $P{VAR_Field_0} THEN m.BRANCHE END AS Field_0, CASE WHEN 'branche' = $P{VAR_Field_1} THEN m.BRANCHE END AS Field_1, CASE WHEN 'branche' = $P{VAR_Field_2} THEN m.BRANCHE END AS Field_2, CASE WHEN 'branche' = $P{VAR_Field_3} THEN m.BRANCHE END AS Field_3, CASE WHEN 'branche' = $P{VAR_Field_4} THEN m.BRANCHE END AS Field_4[…] but, of course, it can't work because of the duplicate fields. I've well found some solutions — I'd tried with a stored procedure — here but they don't work with an Oracle database. (Only the first field is filled)I realy need to quikly develop this report and don't see any other solution.If someone can help me. ThanksPost Edited by nimal at 09/21/2010 11:00Post Edited by nimal at 09/22/2010 08:30 Link to comment Share on other sites More sharing options...
nimal Posted September 21, 2010 Author Share Posted September 21, 2010 Maybe is it possible with something like this: CASE WHEN $P{param} = 'fix' THEN m.TOTEM WHEN 'Sexe'='Cotisation' THEN m.COTISATION END as Field_0 ??? Link to comment Share on other sites More sharing options...
nimal Posted September 22, 2010 Author Share Posted September 22, 2010 It's possible to do with : SELECT $P!{Column_name} AS Alias, […] FROM […] 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