how do I create a list with comma separated values and a dynamic list-size?

0

Hi, 

title says it all. I'm using a json as datasource.
In this json I got an array of objects:

{
 
        "item": {
 
            "somePeople": [{
 
                "user": {
 
                    "id": 1,
 
                    "name": "Alice"
 
                }
 
            }, {
 
                "user": {
 
                    "id": 2,
 
                    "name": "Bob"
 
                }
 
            }, {
 
                "user": {
 
                    "id": 3,
 
                    "name": "Mallory"
 
                }
 
            }]
 
        }
 
    }

My report is using item as query. The dataset from that list is using item.somePeople as query; the field in this list is user.name.
Is there any possibility to display those values comma separated with a dynamic list-size?

schakkalakka's picture
Joined: Jun 17 2014 - 5:17am
Last seen: 11 months 2 weeks ago

Progress!

$V{allName} + $F{name} + ", "

I'm using a subreport to print this value.
But my current problem is that I get 3 rows of names:

name1,

name1, name2,

name1, name2, name3,


But all I want is the last one

Any suggestions?

Thanks,

schakkalakka

schakkalakka - 4 years 8 months ago

2 Answers:

0

The above suggests you're populating a variable allName with each row, in which case all you may need is a TextField with 'Evaluation Time' set to Report and reference $V{allName}.

Alternatively, if you know how many rows you have, you can use a conditional print looking at REPORT_COUNT to check if it's the final row before printing the detail band.

gnomeking_jasper's picture
Joined: Jun 30 2014 - 2:31am
Last seen: 4 years 8 months ago
0

i am too looking for priting list of values into single text fields with comma separated , can you please your sample. since when i apply above hints its still prints list of values for me. i want only the last values. 

2340patel's picture
Joined: Jan 11 2018 - 8:38pm
Last seen: 1 month 1 week ago
Feedback
randomness