tmiller_1 Posted October 9, 2013 Share Posted October 9, 2013 Didn't find what I was looking for in the forum but if this is already answered point me in the right direction.What I am trying to do is create a report that would allow one to serveral (not sure on how many) parameters to be passed to generate a report.So what the report consists of is a user will input a Charge Code and they can enter in One code and run the report or they can enter 10 Charge Codes and run the report.What do I need to do to allow for this?Thanks,TM Link to comment Share on other sites More sharing options...
ajinkya_c Posted October 10, 2013 Share Posted October 10, 2013 Hi,Try multi-slect list of values input control so that you can select any number of values from list.You can also provide default charge_code value when none of value selected.Hope this helps.ThanksAjinkya Link to comment Share on other sites More sharing options...
tmiller_1 Posted October 10, 2013 Author Share Posted October 10, 2013 Okay I see the multi select list values. What I am not wrapping my head around is how to get the sql statement changed accordingly on the fly. TM Link to comment Share on other sites More sharing options...
ajinkya_c Posted October 11, 2013 Share Posted October 11, 2013 Why you want to change sql in input control, Are you looking for cascading input control. Link to comment Share on other sites More sharing options...
tmiller_1 Posted October 14, 2013 Author Share Posted October 14, 2013 Well the goal is that they can input several "Codes" to run the report from. I can do a single but I want a multiple codes to be inputted and update the sql accordingly. my current query is the following. Where (Year(chg_srv_ts)=2013) AND ((chg_code=7111)) So what I am thinking is the following if they are doing multi entry. Where (Year(chg_srv_ts)=2013) AND ((chg_code=7111) or (chg_code=7221) Or (chg_code=8155)) Any Ideas. Link to comment Share on other sites More sharing options...
tmiller_1 Posted October 15, 2013 Author Share Posted October 15, 2013 Well I found what I am looking for in the SQL Statement.The SQL In Function allows multiple values to inputted for a statement.Select * From Users Where user.id in (1,2,3,4,5) Now just having difficulties with it in the jasper designer to work properly. TM Link to comment Share on other sites More sharing options...
ajinkya_c Posted October 16, 2013 Share Posted October 16, 2013 Hi,Your query where condition in report may be:Where Year(chg_srv_ts)=2013) AND chg_code in (7111 ,7221,8155) orif you are using parameter for chg_code like $P{chg_code} then query becomesWhere (Year(chg_srv_ts)=2013) AND $X{IN, chg_code, $P{chg_code} } =====$P{chg_code} datatype java.util.collection or java.util.listand your multiselect list input control query is select chg_code from table_nameHope this helps.ThanksAjinkya Link to comment Share on other sites More sharing options...
tmiller_1 Posted October 16, 2013 Author Share Posted October 16, 2013 Okay that helped alot thanks for the assistance. Link to comment Share on other sites More sharing options...
Solution tmiller_1 Posted October 16, 2013 Author Solution Share Posted October 16, 2013 Okay after much assistance from everyone this is what I ended up doing.Set the Charge Code Parameter to a Collection.Changed the query to the followingWhere (Year(chg_srv_ts)=2013) AND ($X{IN, field_chg_code, parameter_chg_code })Then on the form itself had to change the language from groovy to Java or else you will get errors.TM 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