Priter's problem

Posted by: mill009 on 4 August 2017, 3:05 pm EST

  • Posted 4 August 2017, 3:05 pm EST

    Hi
    I have a problem when printing.  For example ,I want to print 7 rows in each page and after printed the 7rows the printer could change another page of paper !  How can I do ?



    Thanks!
    Mill

  • Replied 4 August 2017, 3:05 pm EST

    If your bound controls are in the Detail section, you may be able to count the times that the Detail_Format event fires and enable a PageBreak control conditionally based on the value. For example ...

    Private rowCount As Integer

    Private Sub ActiveReport_ReportStart()
        rowCount = 0
    End Sub

    Private Sub Detail_Format()
        rowCount = rowCount + 1
        If rowCount = 7 Then
            Me.PageBreak1.Enabled = True
            rowCount = 0
        Else
            Me.PageBreak1.Enabled = False
        End If
    End Sub


    Tim
  • Replied 4 August 2017, 3:05 pm EST

    Why would you use a pagebreak control when you could use the NewPage property of the section?


    Private Sub Detail_Format()
        rowCount = rowCount + 1
        If rowCount = 7 Then
            Me.Detail.NewPage = ddNPAfter
            rowCount = 0
        Else
            Me.Detail.NewPage = ddNPNone
        End If
    End Sub

  • Replied 4 August 2017, 3:05 pm EST

    You are correct, either will work. NewPage will also allow extra options through the NewPageConstants. However, either choice should work fine.

    Tim
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels