Hi,
I have two input controls MySecteur and MyRayon, and I want to synchronize them. The control type is mutli select query , the query like this :
SELECT DISTINCT "Secteurs", "Rayons","No_nomenclature" FROM "Nomenclatures_articles" WHERE $X{IN, "Secteurs", MySecteur} ORDER BY "No_nomenclature"
Where MySecteur is the name of the first input control.
When I execute the report, and I want to do my choice, the input control not synchronized but a small windows tell me to wait but nothing to do.
Is someboby can hep me to resolve this problem
Best regerds
Fabrice
3 Answers:
Hi,
I did same requirement which I explaine here which may help you.
From MySecteur and MyRayon parameters when I select values from MySecteur then values in MyRayon filtered by MySecteur so In list i can show only those values which are under MySecteur. Here i Consider MySecteur at higher level than MyRayon.
For that when i create multiselect query of MyRayon then i add filter of MySecteur in query of input control. And use MySecteur and MyRayon parameters in Report query.
You can also use P!{} for using dynamic where condition. That is if user provide values for any parameter then it used in query and if null then where condition not consider in query.
Hope it may helps you.Let me know if any issue.
Thanks,
Ajinkya
Maybe this will help you out:
For a cascading input control you need a query in your report that includes a WHERE clause and references to the parameters that you have in your report. So, for example, you might have the following in your main report (the two parameters are country and state_list):
WHERE store_country = $P{country} AND $X{IN, store_state, state_list}
ORDER BY store_country, store_state, store_name
You will need a Single-select Query for the country parameter, which requires both a db connection and a query. Your query might look like this: SELECT DISTINCT store_country FROM store ORDER BY store_country. You will need a Multi-select Query for the state (state_list) since countries can have more than one state or district. Again, you will need a db connection configured and a query. The query for the state parameter might look like this: SELECT DISTINCT store_state FROM store WHERE store_country = $P{country} ORDER BY store_state. When you run the report you will be prompted to select a country (single select) and the states associated with that country will load underneath. Pick the state or states that you wish to include in your report, and then click the Ok button.