lovanc Posted April 27, 2011 Share Posted April 27, 2011 I am trying to create a simple cascading parameter whihc I cannot get working. I am hoping that someone can spot the error in my configuration. I created an Input Control called element_class as a "Single Select Query" type input control.It runs the following queryselect id as element_id, name as element_namefrom element_classto populate the selection list. The value column is "element_id" and the Visible Query Columns is "element_name" This list populates successfully The second Input Control is called "filtered_model_element". It is also a "Single Select Query" type input control.The Query it runs isselect id as model_element_id , name as model_element_namefrom model_elementwhere element_class = $P{element_class}and entity_status is null This second input control does not populate when I select something form the first. I see the visual icon showing that the server is doing something but the list stays empty. Thank you in advance for your time.Post Edited by lovanc at 04/27/2011 13:43 Link to comment Share on other sites More sharing options...
khahn Posted May 1, 2011 Share Posted May 1, 2011 I'm not sure about this, but if you don't mind experimenting, try $P!{parameter name} in the second query. Here is some documentation I gleaned from our JasperReports, iReport, and JasperReports Server Ultimate Guides:When the value of the parameter is not a simple value, but a chunk of the query or the whole query, use:$P!{parameter_name}Use this syntax to indicate that the parameter does not have to be dealt as a value to transfer to a prepared statement, but that it represents a little piece of the query. The server does not bind the parameter to a SQL parameter. It calculates the value of the parameter and evaluates it as a raw subsection of a query.For example, if you have a parameter named MyWhere with the value of "whereCUSTOMERID = 5", the query:select * from customers $P!{CUSTOMERID}will be transformed into:select * from customers where CUSTOMERID = 5without using the logic of the SQL parameter. Make sure that the parameter value is correct in order to avoid an error during the query executionPost Edited by khahn at 05/01/2011 16:41 Link to comment Share on other sites More sharing options...
rida_10 Posted May 5, 2011 Share Posted May 5, 2011 well iovanc, ur mistake is that u wrote element_class = $P{element_class} in the where clause part of the query. if for every id in element_class param thery is a list of filtered_model_element then u should wrote: model_element.id = $P{element_class} Link to comment Share on other sites More sharing options...
honeybakliwal Posted August 11, 2011 Share Posted August 11, 2011 Heyllo everyone i tried cascading parameters and did the same thing what is explained in the cascading parameter example in the sample reports My Requiremnt is i having 2 parameter say State(java.util.collection type) which is of multi select query type and have query as select distinct Customer_State from customer order by Cutomer_State; Another parameter named as City (java.lang.String) which is of single select query which has query as select distinct Cutomer_City from customer $X{IN,Customer_State,State} This second input control does not populate when I select something form the first. I see the visual icon showing that the server is doing something but the list stays empty. Thank you in advance for your time. Link to comment Share on other sites More sharing options...
honeybakliwal Posted August 11, 2011 Share Posted August 11, 2011 Post Edited by honeybakliwal at 08/11/2011 05:53 Link to comment Share on other sites More sharing options...
khahn Posted August 12, 2011 Share Posted August 12, 2011 Thanks for your interest in using JasperReports Server. Attached is a tutorial for creating a city-state cascading input control. If you need more detail, don't hesitate to ask. Good luck!Post Edited by khahn at 08/13/2011 22:21Post Edited by khahn at 08/13/2011 22:27 Link to comment Share on other sites More sharing options...
mariovela Posted November 22, 2011 Share Posted November 22, 2011 Hello!!I actually would like to explore the opposite scenario. I have a report that I need to disable the cascading efefct in my controls... for some reason my report gets the "thinking" pop-up every time I change a value in the controls even though I did not configure them for cascading. Is there a wway to prevent such behaviour???Any help will be really appreciated!Mario 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