display list of values as comma separated value from json into text field

0

I have a json as below "markets": [ { "id": "1001", "name": "val1" }, { "id": "1002", "name": "Val2" }, { "id": "1003", "name": "val3" } ]

I am trying to display as following in jasper jrxml text fields val1, Val2, val3.

i defined my field expression as follow

<field name="market" class="java.lang.String">
    <property name="net.sf.jasperreports.jsonql.field.expression" value="markets*.name"/>
<textField isStretchWithOverflow="true">
            <reportElement x="80" y="40" width="100" height="16" uuid="903a6728-3a7a-4d1a-9b70-cd8da7a11c7f"/>
            <textElement>
                <font size="9"/>
            </textElement>
            <textFieldExpression><![CDATA[$F{market}]]></textFieldExpression>
        </textField>

However only one value is displayed i.e. val1.

how to display list of values. as val1,val2,val3 into single text field

Thanks,

Anjana

2340patel's picture
Joined: Jan 11 2018 - 8:38pm
Last seen: 2 months 2 weeks ago

2 Answers:

0

Hi,

 

Has anyone come across this scenario. 

 

Thanks

Anjana

2340patel's picture
Joined: Jan 11 2018 - 8:38pm
Last seen: 2 months 2 weeks ago
0

this is solved  by folllowing technique described here https://stackoverflow.com/questions/52965617/jasper-converting-list-of-v...

2340patel's picture
Joined: Jan 11 2018 - 8:38pm
Last seen: 2 months 2 weeks ago
Feedback