Getting report rows from a java-class defined template

The reports manual says how to return data from a parameter but not a single word about the report itself.

My report generates a text file, but… How to read band’s result? I got a band, say, dataBand which have a list of maps in my groovy dataset which looks like
[ [ 'enum': 1, 'payload': 'hello' ], [ 'enum': 2, 'payload': 'world' ] ]

in my java-defined template i have
return rootBand.getChildByName("dataBand").getData().toString().getBytes
which returns me only a first map in list [ 'enum': 1, 'payload': 'hello' ]. how to get all the next results in this dataset?

Hi,

rootBand.getChildByName("dataBand") returns list with band data. You can iterate over list and access data by getData.

Thanks

Hi Andrey, I think you meant
rootBand.getChildrenByName("dataBand")

1 Like