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