Jump to content
We've recently updated our Privacy Statement, available here ×

[Resolved] Variable fields


nimal

Recommended Posts

 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 :

 SELECT

DISTINCT (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.

 

Thanks



Post Edited by nimal at 09/21/2010 11:00



Post Edited by nimal at 09/22/2010 08:30
Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

 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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...