none
How to print a line up to or before page footer? RRS feed

  • Question

  • I have a vertical line in the detail section to separate the value of a column and I want it to be printed up to or before the page footer. The line stops based on the record of the detail section. Example if the second page stops at the center then the line will stop there also.

    In MS Access report I have the following code:

     

    Private Sub Report_Page()
      If Page = 1 Then
        FirstPageLine
      ElseIf Page = 2 Then
        SecondPageLine
      End If
    End Sub
    
    Private Sub FirstPageLine()
      Dim X1, Y1, X2, Y2 As Single
      Me.DrawStyle = 0    ' a solid line
               
      Me.DrawWidth = 1   ' set the thickness of the line
                     
      ' Set the coordinates and draw a line down the middle of the page.
      
      X1 = 8700 'Int(Me.ScaleWidth / 2)   ' find the middle of the page
      Y1 = 3990 'Me.Section(3).Height  ' start just below the page header
      X2 = X1                 ' the line is vertical
        
      ' length of line is the length of the Page - (Height of the PageHeader + Height of the Page Footer).
      
      Y2 = Me.ScaleHeight - (Me.Section(1).Height + Me.Section(4).Height)
      
      Me.Line (X1, Y1)-(X2, Y2)    ' This draws the line
      Me.Line (9950, Y1)-(9950, Y2)
      Me.Line (1560, Y1)-(1560, Y2)
    End Sub
    
    Private Sub SecondPageLine()
      Dim X1, Y1, X2, Y2 As Single
      Me.DrawStyle = 0    ' a solid line
               
      Me.DrawWidth = 1   ' set the thickness of the line
                     
      ' Set the coordinates and draw a line down the middle of the page.
      
      X1 = 8700 'Int(Me.ScaleWidth / 2)   ' find the middle of the page
      Y1 = 500 'Me.Section(3).Height   ' start just below the page header
      X2 = X1                 ' the line is vertical
        
      ' length of line is the length of the Page - (Height of the PageHeader + Height of the Page Footer).
      
      Y2 = Me.ScaleHeight - (Me.Section(1).Height + Me.Section(4).Height)
      
      Me.Line (X1, Y1)-(X2, Y2)    ' This draws the line
      Me.Line (9950, Y1)-(9950, Y2)
      Me.Line (1560, Y1)-(1560, Y2)
    End Sub

    Is this possible in RDLC?



    • Edited by Jay Pabs Friday, June 24, 2011 3:21 PM use code formatting
    Friday, June 24, 2011 3:17 PM