In the designer you can insert the design element,
Skip iterations directly within a
Repeat element. This should be inserted as the last element within the repeat loop.
This can be used for skipping some of the iterations. In order to insert a skip iterations element you need to click this design icon:
This icon is found by first clicking the Repeat element a child element and then clicking the '+' icon as shown below:
The Skip iterations element has a single parameter, which is to be set to the iterations, that are to be skipped:
In the screen shot above the variable is setup to be the value of a variable. If the repeat is to execute as normally you should set this variable to 0 (zero).
Example: Skip a section of spooled file lines
Here is an example of where the skip iterations element can be used:
In this case we have a spooled file with a section of 4 lines, which starts with the text 'Congratulations' like below:
If the text 'Congratulations' is found, then we want to output the current line and the following 3 lines in bold within a box. We do not know anything about the text of these 4 lines so in principle the text 'Congratulations' could even appear again.
In order to prevent unnecessary conditions we want to skip these 3 lines from a line repeat loop and handle all of the 4 lines in a condition.
The solution use the skip iterations element and looks like below:
The repeat loop handles 50 spooled file lines starting in line 6.
In the repeat loop we set the value of the variable, Skip to 0. That will cause the repeat to behave normally and iterate through all of the spooled file lines.
If the Congratulations text is found, then we add a container with a border, insert the 4 lines of text from the spooled file inside and set the Skip variable to 3.
This cause the Skip Iterations to skip the extra 3 lines we just handled.
If Congratulations is not found we simply output the current spooled file line (we set a fixed height of this text so that empty lines are also output).