假設我們的單據每張共打印五行,則最多會增加空白行4行, 在重復出現的表體中定義四個空白節。 我們首要的任務是根據記錄數來確定這四個節什么時候顯示,什么時候不顯示。 我們定義的節的抑制顯示腳本為: 節1,只有當記錄數等于1時才需要顯示第一個空白節。 if onlastrecord=false then formula = true else
if (count({銷售單表體.商品代碼}) mod 5 > 1) then formula = true else if (count({銷售單表體.商品代碼}) mod 5 = 0) then formula = true else formula = false end if end if end if
節2,只有當記錄數等于1或等于2時才需要顯示第二個空白節。 if onlastrecord=false then formula = true else if (count({銷售單表體.商品代碼}) mod 5 > 2) then formula = true else if (count({銷售單表體.商品代碼}) mod 5 = 0) then formula = true else formula = false end if end if end if