How to show several fields values in one textField

前端 未结 2 1148
一向
一向 2020-12-10 16:23

Can nay one help to add multiple DB field values in one field.

Say i have 3 DB fields:

Name
Address
Age

I want to display all 3 fie

2条回答
  •  星月不相逢
    2020-12-10 16:30

    The SQL Method

    Why not concatenate all the 3 fields you need in the query you use itself like (Assuming you are with Postgres.),

    select (name || address|| to_char(age)) as data from my_table
    

    In Ireport

    As suggested,

    $F{Name} + "." + $F{Address} + "." + $F{Age}.toString()
    

    too works if needed to make it work from the report.

    Make sure that all your fields are of same data type.

提交回复
热议问题