Page break after X items

Is it possible to force a page break after a specified number of items in a table
For instance, I have a name badge report but I'm running into a problem where some badges are sliced down the middle at page breaks when exporting to pdf or tiff.  If I could force a page break after every 2nd or 3rd badge it would alleviate that problem.

Thanks in advance.


Answer this question

Page break after X items

  • uSam

    Hi Nblankton

    thank you for the response, after I wrote the note I searched the forum and found this

    "=Ceiling(RowNumber(Nothing)/4)" you can put any number (2,5,20) it works, without having to add any code.

    Thank you for your help. adding a group to control the amount of record per page is a great idea.

    MQ


  • Dazza999

    Hello Nblankton

    that was a very good idea, I did try to use it but for some reason it only works with 2 records.

    I tried to change it with Mod 4 (I thought that would break after 4 records but that is not the case, I page break after the 1,2 and 4th record).

    I'm not sure if I'm missing something or it is a bug.

    Any Idea

    Thank you

    MQ


  • oldboy67

    Figured it out.  I added a group on Code.GetCount(RowNumber(Nothing)) with a page break at the end and added this function:


    public shared function GetCount(CurrentCount As Integer) As Integer
     If CurrentCount Mod 2 = 0 Then
      GetCount = CurrentCount-1
     Else
      GetCount = CurrentCount
     End If
    end function

     

  • TheDigitHead

    hi, I hope someone can help me!
    I don't understand where I must place "=Ceiling(RowNumber(Nothing)/4)"

    I added a new group (I selected table, right-click Proprieties, groups and add)
    and I've write "=Ceiling(RowNumber(Nothing)/4)" as expression, but when I tried to execute , an error rose!
    A scope problem

    did I wrong the place to write the expression

    Thanks in advance

  • ArieK

    You'd also need to also alter the CurrentCode-1 line to subtract the appropriate number so that for all four that returned number is the same.

    Something like CurrentCode-(CurrentCode Mod 4)+1.

    I worked out a different method later that I think is a little clearer, though. This groups by 3's:

    public shared function GetCount(CurrentCount As Integer) As Integer
    GetCount = (CurrentCount+1)/3
    end function


  • Page break after X items