close
案列描述:

 假設一頁顯示七筆,現在總顯示筆數是十筆,

 在第二頁的時候會顯示三筆,然後以下空白,

 但現在需要以下補完空白行,所以... 需要動點手腳唷!!

方法描述:

 1.在 Crystal Report 的 rpt 中,產生多個細目區段,並畫入空白行格式(N-1個)。

 2.在原來的細目資料中(細目a),開啟「區段專家」,在「在之後新增分頁」點選「公式」,鍵入以下公式1

 3.每個空白行細目區段中,開啟「區段專家」,在「抑制顯示(無擷取項目)」點選「公式」,鍵入以下公式2

公式1:

if onlastrecord then
   formula = false
else
   if RecordNumber mod 7 =0 then
      formula =true
   else
      formula =false
   end if
end if

公式2:

細目b(第一個):

if not onlastrecord or (RecordNumber mod 7 = 0) then
   FORMULA = TRUE
else
   if (RecordNumber mod 7 <=1 ) then '第一筆
      FORMULA = FALSE
   else
      FORMULA = TRUE
   end if
end if

細目c(第二個):

if not onlastrecord or (RecordNumber mod 7 = 0) then
   FORMULA = TRUE
else
   if (RecordNumber mod 7 <=2 ) then '第二筆
      FORMULA = FALSE
   else
      FORMULA = TRUE
   end if
end if

以此類推...至N-1個,

醬就口以達成不足列時,以空白行補足了唷!

以上.. 祝大家使用愉快!!
arrow
arrow
    全站熱搜

    張小芸 發表在 痞客邦 留言(0) 人氣()