Assuming that each of our documents prints a total of five lines, a maximum of 4 blank lines will be added.
Define four blank sections in the recurring table body.
Our first task is to determine when these four sections are displayed and when not based on the number of records.
The suppressed display script of the section we defined is:
Section 1, the first blank section needs to be displayed only when the number of records is equal to 1.
if onlastrecord=false then
FORMULA = TRUE
else
if (COUNT({Sales order table body.Commodity code}) mod 5 > 1) then
FORMULA = TRUE
else
if (COUNT({Sales order table body.Commodity code}) mod 5 = 0) then
FORMULA = TRUE
else
FORMULA = FALSE
end if
end if
end if
section 2, the second blank section needs to be displayed only when the number of records is equal to 1 or equal to 2.
if onlastrecord=false then
FORMULA = TRUE
else
if (COUNT({Sales order table body.Commodity code}) mod 5 > 2) then
FORMULA = TRUE
else
if (COUNT({Sales order table body.Commodity code}) mod 5 = 0) then
FORMULA = TRUE
else
FORMULA = FALSE
end if
end if
end if
the other two sections, and so on is very simple.
Note that the demarcation condition is the processing of the case where 0 is returned after complete modulus and the number of records itself is zero.