Search code examples
jasper-reports

I want to separate data from my field in the band detail with a comma and without a comma in the last item on Ireport


For example, my field has the comma value added by the field pattern: 21, 22, 23, 26,

but I wanted it to be: 21, 22, 23, 26

or go further: 21, 22, 23 and 26

but without the last comma it would be enough.

remembering that this is referring to in the context of ireport.


Solution

  • Unlike many here who decide to just deslike instead of helping even though they are experts on the subject. I suggest a solution: My doubt was that I wanted my field elements to be separated by a comma and not have that annoying comma in the end example: item1, item2, item3, I wanted it to look like this: item1, item2, item3

    and the way to go about doing that is: $ V {Variable created to format}! = Null? $ V {Variable created to format} + "," + $ V OR F {Variable with your field or your field}: $ V OR F {Variable with your field or your field}