Line coding for report problem (1 Viewer)

jjake

Registered User.
Local time
Today, 12:13
Joined
Oct 8, 2015
Messages
291
Hello,

I am using the following code to generate vertical lines for my report but im having a slight overhang.

Code:
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)

Dim ctrl As Control
Dim intLineMargin As Integer

' This is the spacing between the right edge of the
' control and the Vertical Seperation Line
intLineMargin = 0

 For Each ctrl In Me.Section(acDetail).Controls
        With ctrl

            If ctrl.Tag = "ItemDescription" Then

                Me.Line (0, 0)-(0, 0 + .Height + 150)

                Me.Line ((.Left + .Width), 0)-(.Left + .Width + intLineMargin, .Height + 150)
            End If
            
                    If ctrl.Tag = "DocumentDetails" Then
        Me.Line ((.Left + .Width), 0)-(.Left + .Width + intLineMargin, .Height + 150)
        End If

    End With
Next

Set ctrl = Nothing


End Sub

Any ideas to fix this as circled below. I have a horizontal line placed at the very bottom of the detail section and i cant move it any further down.

 

June7

AWF VIP
Local time
Today, 09:13
Joined
Mar 9, 2014
Messages
5,477
Oops! Just noticed the issue is with horizontal line, which I did not have. Now testing.

My report has records filling page, nothing in footer sections, just a simple list.

I removed page header/footer sections and the overhang went away.

I reduced the line Height by 360 and overhang went away on page 1. But page 2 with fewer records shows line extended to bottom of page. My Code:
Code:
Private Sub Report_Page()
Dim x As Integer
'1440 twips per inch
For x = 1 To 8
    Me.Line (Me.Controls("lin" & x).Left, 720)-(Me.Controls("lin" & x).Left, 15120 - 360)
Next
End Sub
Just noticed alternate line color is messed up for last record on first page. A thin bar of shading is on first page but the record is on second. Annoying.
 
Last edited:

isladogs

MVP / VIP
Local time
Today, 18:13
Joined
Jan 14, 2017
Messages
18,241
I use similar code to create grids on reports and have found similar issues though not usually as marked as yours
I work round these by just making the vertical lines slightly smaller than they 'should' be

the attached screenshot shows an example - its from a dynamic crosstab report
 

Attachments

  • ResidualsReport.jpg
    ResidualsReport.jpg
    107 KB · Views: 113

Users who are viewing this thread

Top Bottom