rbaudchon Posted September 25, 2009 Share Posted September 25, 2009 Hi,I have made a report with iReport 3.0.0 using a collection as parameter. This collection is a list of customer code that I want to keying manually. When I run the report from iReport, it works fine. I can put 1 or several code and I have my report.I have created a new report unit in jasperserver. In the input control, I can not have a type "collections", only string. I have tried using string, but then I have an error message.How can I convert string to collections in order to have my report running ?I do not want to have a input control based on a multiple query, because I have more than 2000 customers.So, if you have any idea, it wiil be helpfull.ThanksRemi Link to comment Share on other sites More sharing options...
Gaby38 Posted September 25, 2009 Share Posted September 25, 2009 One suggestion : not to use a collection but a string. If I well understand, you want to key manually the ids or names of your cutomers, so you have to key something like : " 1,2,3,....,N".If you use a collection you certainly use the $X{} parameter syntax in your query.My suggestion is to use a single value input control with string type and , when prompted, you key your list of values :"1,2,3,..." and declare the parameter as string.In your query you replace the $X{} by a "classical" sql clause : where userid in ($P!{StringListValue}) (notice the "!" after $P)If you had not 2000 customers, you could use a multiselect query with a collection but you don't want.Hope this will help Link to comment Share on other sites More sharing options...
rbaudchon Posted October 2, 2009 Author Share Posted October 2, 2009 Thanks for your anwer, I will try and let you know Remi Link to comment Share on other sites More sharing options...
rbaudchon Posted October 2, 2009 Author Share Posted October 2, 2009 no it doesn't work. i have got java.sql.SQLException: ORA-00907: missing right parenthesis, when trinh to use "!" after $P. I have create a new easy query as follow: select c.name as CustomerName from sbedba.cust c where c.code in ($P!{customerliststring}) Link to comment Share on other sites More sharing options...
Gaby38 Posted October 2, 2009 Share Posted October 2, 2009 It's strange! To be sure, I created a small report with only one detail band and one field "NomAct".I defined the query as "select lib_nom_act as NomAct from activitewhere id_act in ($P!{ListAct})"and defined a string parameter ListAct. and an Input control ListActI run the report; when prompted, I key : 1,2,3 and I get the right list of name activities without error.So I don't understand why in your case it doesn't work. 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