Hi,
It's a bit difficult to say where could be a problem when you share just code snippets.

It's the easiest to help when you replicate your problem in a MINIMAL portion of code in our playground https://playground.jsreport.net/
If this is possible for you, please share it with us and we take a look.