JasperReport - Passing objects to report column

0

I have to get the data from the following field:

venda.getVendacardinalidades().get(0).getUsuario().getPessoa().getNome()

And put this value in a report column, how do I do this:

I was trying to do this:

<field name="nome" class="com.vendas.model.VendaCardinalidade"/>
...

<textField isStretchWithOverflow="true">
    <reportElement x="0" y="0" width="187" height="20" forecolor="#666666" uuid="47de42ee-e4c9-4c89-9d64-03fb5ecb4fb6"/>
    <box rightPadding="2"/>
    <textElement textAlignment="Justified" verticalAlignment="Middle"/>
    <textFieldExpression><![CDATA[$F{nome.getVendacardinalidades().get(0).getUsuario().getPessoa().getNome()}]]></textFieldExpression>
</textField>

But it goes wrong, how to do it? Thank you in advance!

    
asked by anonymous 07.09.2016 / 22:19

1 answer

0

I got through the logic:

I did so:

<field name="vendacardinalidades[0].usuario.pessoa.nome" class="java.lang.String"/>

...

<textField isStretchWithOverflow="true">
    <reportElement x="0" y="0" width="187" height="20" forecolor="#666666" uuid="47de42ee-e4c9-4c89-9d64-03fb5ecb4fb6"/>
    <box rightPadding="2"/>
    <textElement textAlignment="Justified" verticalAlignment="Middle"/>
    <textFieldExpression><![CDATA[$F{vendacardinalidades[0].usuario.pessoa.nome}]]></textFieldExpression>
</textField>

Right!

    
07.09.2016 / 22:40