Jump to content
Changes to the Jaspersoft community edition download ×

Recommended Posts

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

  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

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

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...