If I have an initial value of 3 that parameter named INDEX, how do I loop the static filed 3 times?
Parameter : INDEX=3.
The report will show: Field_1 ,Field_2,Field_3;
Parameter : INDEX=5
The report will show: Field_1 ,Field_2,Field_3,Field_4, Field_5;
1 Answer:
Posted on May 21, 2018 at 1:35am
1. Create a Variable, for example, called [TestList], expressions like:
java.util.Arrays.asList( "Field_1","Field_2","Field_3","Field_4","Field_5" )
2. Create a Parameter called [ListSize], type Integer.
3. Create a Textfield, use this code to print the list, the printed list item is based on your parameter [ListSize] input.
$V{TestList}.subList(0,$P{ListSize})