CHOSEN MULTIPLE SELECTION TABLE WITH JASPER REPORT

278 views
Skip to first unread message

i...@grupolamper.com

unread,
Nov 10, 2021, 7:42:30 AM11/10/21
to iDempiere
Good Day,

Have anyone been able to use a chosen multiple selection table in a report from jaspersoft?

So far in Designer Level i have setup this:

Param Name:  p_c_bpartner_id
Class: java.util.collection
Netsted Type Name: java.math.Integer
Query string at the end: "AND $X{IN,cbp.c_bpartner_id,p_c_bpartner_id}"

At designer level works perfect by adding inside the collection the values i need to be shown, but when i add this to iDempiere it gives me the following error:
** ProcessError Invalid type java.lang.String for parameter p_c_bpartner_id used in an IN clause; the value must be an array or a collection.

parametroJasper.png

Thanks in advance for any help I can get regard this

Heng Sin Low

unread,
Nov 10, 2021, 8:56:07 AM11/10/21
to idem...@googlegroups.com
It is pass as a comma separated string, not collection.

--
You received this message because you are subscribed to the Google Groups "iDempiere" group.
To unsubscribe from this group and stop receiving emails from it, send an email to idempiere+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/idempiere/899013d1-ddf9-4ffe-91a3-1328bb400e8cn%40googlegroups.com.

i...@grupolamper.com

unread,
Nov 10, 2021, 10:37:04 AM11/10/21
to iDempiere
Hello hengsin,

Thanks for your quick reply,

Based on your comment i did changed then my Param as:

Param Name:  param_c_bpartner_id
Class: java.lang.String
Query String:
parametroinJasper.png

And now I don't have an error, but my report shows blank, its like it does not recognize the data, since I had to change my Param to String, I had as you see in query String to CAST the column to Character Varying, maybe I'm doing something wrong?

What are your thoughts?

Heng Sin Low

unread,
Nov 10, 2021, 10:59:14 AM11/10/21
to idem...@googlegroups.com
cbp.c_bpartner_id = any(string_to_array($P{param_c_bpartner_id}, ',')::int[]);

Saulo Gil

unread,
Nov 10, 2021, 11:01:09 AM11/10/21
to idem...@googlegroups.com

Hello,

You could try with the following expression:

AND cbp.c_bpartner_id IN ($P{param_c_bpartner_id})

Regards,

Saulo Gil | Orbital Software  | +54 911 3049 4237

i...@grupolamper.com

unread,
Nov 10, 2021, 12:19:47 PM11/10/21
to iDempiere
Hello Hengsin,

This did solved my problem...

Thanks a lot...

i...@grupolamper.com

unread,
Nov 10, 2021, 12:20:54 PM11/10/21
to iDempiere
Hi Saulo,

Problem with that sentence is that since what comes is a string and the column is integer it does not solve the cast issue...

But with the way Hengsin wrote before it works like a charm...

Thanks 

Saulo Gil

unread,
Nov 11, 2021, 6:33:01 AM11/11/21
to idem...@googlegroups.com

Hello,

I believe Jasper adds quotes to values, that's why it doesn't work ( I haven't tested it at all). Looking at the documentation, if the parameter is given to Jasper as a collection or array, the following expressions should work:

AND cbp.c_bpartner_id IN ($P!{param_c_bpartner_id})

OR

AND $X{IN, cbp.c_bpartner_id, param_c_bpartner_id}

Regards,

Saulo Gil | Orbital Software  | +54 911 3049 4237

Reply all
Reply to author
Forward
0 new messages