How do I put a vertical line down the middle of the detail section of a two-column report?
I know that I can put a line at the right end of the column 1, but it will repeat at the right end of column 2,
and I don't want that. Same principle applies to putting a line at the left end of column 1;
it will repeat at the left end of column 2.
Any and all help will be gratefully accepted.
Place this code in the Report's Page event to draw a line down the
center of the page, from the bottom of the Page Header to the top of
the Page Footer.
You'll need to change X1 if you want the line drawn elsewhere on the
page.
' *** ALL NUMBERS ARE IN PIXELS... ***
Private Sub Report_Page()
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 = Int(Me.ScaleWidth / 2) ' find the middle of the page
Y1 = 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 Page
Header + 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
End Sub
=======
This line
Y1 = Me.Section(3).Height ' start just below the page header
has to be adjusted to start where you wish it to.
If you also have a group header, simply add it's height to the Page
Header height.
Y1 = Me.(Section(3).Height + Me.Section(X).Height
Change the (X) above to whatever the number value of the Group Section
is.
The Report Header section is (1), the Page Header section is (3).
The Group Header section number will vary, according to the layout of
your report. You may have to include any other section's height as
well.