How to Map dropdown (select single query) input control to Jasper report parameter in Jaspersoft Server

I created an input control (single select query), I loaded data to the input control using a select query like the below.

select id,country from countries

My input control has country values displayed for example.

USA,CANADA,EUROPE,.....

once the user choose a particular country then I have to pass the "id" of that selected country to parameter used in the report.

I tried with different ways like the name of the report parameter exactly mapped with name of input control but nothing works.

Kindly provide me the steps to accomplish this since I am struggling for the past two days.

 

 

parthibanmca87's picture
Joined: Sep 10 2015 - 12:06am
Last seen: 7 years 6 months ago

3 Answers:

Hi,

Create a parameter with the exact same id with the input control by right clicking 'parameters' and 'create parameter' in outline window.  In input control, value column has to be set 'id' and visible column has to be set 'country'.

After that, you should add the parameter to your query in dataset. For example,

select * from Sales where countryid = $P{parameterName} 

zh3ntil's picture
3257
Joined: Nov 19 2014 - 11:02pm
Last seen: 6 years 8 months ago

@zh3ntil: Could you please elaborate the steps with screenshots. I have tried with almost all possiblities but nothing works for me. Thanks for your reply

parthibanmca87's picture
Joined: Sep 10 2015 - 12:06am
Last seen: 7 years 6 months ago
zh3ntil's picture
3257
Joined: Nov 19 2014 - 11:02pm
Last seen: 6 years 8 months ago
Feedback
randomness