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"
;
"Diam" field is a smallint, the problem is in this part
$X{IN, cast("Diam" as character varying), DiamRQn}
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 !
Additional inf: DBMS: postgresql ireport ver: 5.0.1
DiamRQn
parameter? – Tom$P{DiamRQn}.toString()
. That way you could see what the input control is passing to the report. – Tom