khaled_khlifi Posted June 8, 2013 Share Posted June 8, 2013 My report based in this request: select "Annee" ,"Diam", sum("Consommation") from "Consom_N","CptDim" where "Annee" >= $P{a1} and "Annee" <= $P{a2} and "Consom_N"."NumCpt"="CptDim"."NumCpt"and "District"= $P{dst} and $X{IN, cast("Diam" as character varying), DiamRQn} group by "Annee","Diam" order by "Annee" ;[/code] "Diam" field is a smallint, the problem is in this part $X{IN, cast("Diam" as character varying), DiamRQn}[/code] DiamRQn is the parameter used by the control input wich is a multiple selection from request, when remove casting it says: PSQLException: ERROR: operator does not exist : smallint = character varying with casting it work fine in ireport preview , but on the jasperserver, the chart shows all the values of "Diam", the selected and the not selected. As i understood,for jasperserver, casted "diam" is always exist in "DiamRQn" collection, although everything went ok for ireport ! Plz check out the attachement Additional inf: DBMS: postgresql ireport ver: 5.0.1 Link to comment Share on other sites More sharing options...
m.longo Posted June 10, 2013 Share Posted June 10, 2013 Try changing the type of the parameter, maybe DiamRQn is passed as a set of string and not numbers Link to comment Share on other sites More sharing options...
khaled_khlifi Posted June 10, 2013 Author Share Posted June 10, 2013 Thank you for replying, but the class of DiamRQn is java.util.Collection, when i set It to java.util.Collection , it not working, when cast the query of the collection select distinct cast("Diam" as smallint) from ... also not working the solution mentioned in the question, work but shows all possible value of "Diam" ! and this is the problem Link to comment Share on other sites More sharing options...
khaled_khlifi Posted June 10, 2013 Author Share Posted June 10, 2013 Thank you for replying, but the class of DiamRQn is java.util.Collection, when i set It to java.util.Collection , it not working, when cast the query of the collection select distinct cast("Diam" as smallint) from ... also not working the solution mentioned in the question, work but shows all possible value of "Diam" ! and this is the problem Link to comment Share on other sites More sharing options...
Thomas Zimmer Posted June 10, 2013 Share Posted June 10, 2013 Are you sure, that the parameter "DiamRQn" gets any values at all on jasperserver? Giving back all possible values is typically a problem, if the passed list is empty (in this case, the whole $X{...} clause is removed from the query...)Cheers, Thomashttp://www.thomaszimmer.net Link to comment Share on other sites More sharing options...
khaled_khlifi Posted June 10, 2013 Author Share Posted June 10, 2013 Thank you Thomas, the request of "DiamRQn" is tested in the DBMS,and if jasperserver fail to execute the request how he shows all the values ? as i undestand, everthing went ok exept the $x{}, jasperserver fail to choose only the selected values but he have all of them, thank you anyway :) 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