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

Choose input parameter in report


gfr

Recommended Posts

 Hi,

I want to do a report that when i execute the report, I choose the parameter from a query in list box. Is it possible to do this in ireport.

I've got a query: Select name from employ where country_id=755

I want to choose one item from the result of this query, and the report is only for this people that i choose.

 

Thanks

 

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Hi,

My understanding is a little different : you want to select an employee through a query as an input parameter and after use the id of this employee to run a report with data only for him. If my understanding is bad, please forget this post!

As for me I would :

- create a parameter named EmployId in the jrxml of the main report

- in the main report define the wanted query with somewhere a clause like " where tab.id_employ=$P{EmployId}"

- create an input control named EmployId with type "Single Select Query" and use your query :

"Select name,id_employ from employ where country_id=755"and in the properties of the input control use the field "name" as "displayed value"and the "id_employ" field as "Value". This input control should fill the EmployId parameter with the selected value

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