gfr Posted June 16, 2009 Share Posted June 16, 2009 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=755I 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 More sharing options...
dnvsrikanth Posted June 16, 2009 Share Posted June 16, 2009 Hi, Declare a parameter in report say p_countryId and give the following query in QueryString: Set the default value of the parameter as the value that you to set by using ternary operator.(? :) Code: Post Edited by dnvsrikanth at 06/16/2009 10:53 Link to comment Share on other sites More sharing options...
Gaby38 Posted June 16, 2009 Share Posted June 16, 2009 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 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