Collection parameter is always null

0

Hi,

I use Jaspersoft Studio, i wanted use collection parameter, i do it in this way: 

        <parameter name="p_aukcje" class="java.util.Collection">
            <defaultValueExpression><![CDATA[Arrays.asList()]]></defaultValueExpression>
        </parameter>

When i wanna use collection parameter in query like this :

where $X{IN, o.aukcja_id, p_aukcje}

my parameter p_aukcje is null, anyone help?

But when i display it using textField it is ok, but i query is null

barteklubocha's picture
Joined: Sep 16 2019 - 2:02am
Last seen: 1 week 3 days ago

_

barteklubocha - 2 weeks 2 days ago

2 Answers:

0

Arrays.asList(T..a) takes an array as part of the method.   Below is how I use it.

 

Adding One Value

<parameter name="p_aukcje" class="java.util.Collection" nestedType="java.lang.String">
    <defaultValueExpression><![CDATA[Arrays.asList("* Wszystkie Aukcje")]]></defaultValueExpression>
</parameter>

Adding Two Values

<parameter name="p_aukcje" class="java.util.Collection" nestedType="java.lang.String" evaluationTime="Early">
    <defaultValueExpression><![CDATA[Arrays.asList("Łodzie", "Samochody")]]></defaultValueExpression>
</parameter>

jgust's picture
196
Joined: Jun 10 2010 - 6:39am
Last seen: 12 hours 32 min ago
0

I understand, but p_aukcje is what i received from input control (collection) on Jasper Server and i need Array List from received collection i don't want to initilize it in defaultValueExpression "rigidly", In Jasper Studio in section Preview in parametr p_aukcje i add two values for example and i want to initialize arrays these values :) If you know what i mean

barteklubocha's picture
Joined: Sep 16 2019 - 2:02am
Last seen: 1 week 3 days ago
Feedback
randomness