You can specify an empty value as a condition for terminating a loop
<loopbreakcondition> <rowcheck offset="0"> <cellcheck offset="0"></cellcheck> </rowcheck> </loopbreakcondition>
This will loop until it finds an empty cell as the first cell ( offset=0 on cellcheck ) in the next row ( offset=0 on rowcheck ) after the last valid pass. You can use the offset attributes to change which cell or row cannot be empty.
Element
A rowcheck can contain any number of cellcheck elements. In my case, none of the cells in the input Excel was required, so I specified an empty cellcheck element for each cell in the row.
Example (suppose there are 3 cells in a row)
<loopbreakcondition> <rowcheck offset="0"> <cellcheck offset="0"></cellcheck> <cellcheck offset="1"></cellcheck> <cellcheck offset="2"></cellcheck> </rowcheck> </loopbreakcondition>
Value:
Stop the loop if all cells in the next row are empty.
In the event that some cells must not be empty, you can simplify the above interruption condition by including only the necessary cells.
Example (it is assumed that there are 3 cells in the cell, and the last cell is required)
<loopbreakcondition> <rowcheck offset="0"> <cellcheck offset="2"></cellcheck> </rowcheck> </loopbreakcondition>
Value:
Stop cycle if the third cell in the next row is empty.
source share