I’ve created a report based of a dataset from Oracle table. I can see the values from query in report preview just fine. Now I need a parameter, which value would be selected from list of values (no manual input). So I have created parameter “p_par”, with default set of values (a, b, c):
<parameter name="p_par" class="java.util.List" nestedType="java.lang.String">
<defaultValueExpression><![CDATA[java.util.Arrays.asList("a", "b", "c")]]></defaultValueExpression>
</parameter>
and I’ve also created a TextField, which shows the value of the “p_par” parameter.
<textField>
<reportElement x="40" y="20" width="171" height="50" uuid="c175df93-2b3e-4b0d-bfd0-975752f8e58d"/>
<textFieldExpression><![CDATA[$P{p_par}]]></textFieldExpression>
</textField>
Now on report preview I can see predefined values
[“p_par” predefined values] (https://i.sstatic.net/6r9iqDBM.png)
But how do I select only one of them?
[“p_par” after pressing “…” button] (https://i.sstatic.net/BtuaE7zu.png)
Highlighting one value an pressing “OK” button doesn’t seem to work and in result the TextField returns all predefined values[“p_par” value in TextField] (https://i.sstatic.net/4h5AFGHL.png)
Any advice would be appreciated.
kaka_demona is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.