Vertical Lines In Report

A

Abdul Shakeel

Hi All,

I want to Print vertical lines in my report detail section is there any way
to do this.

Rgards.
 
W

Wayne-I-M

Hi

Insert a line into the detail section. Make the line width = 0cm and the
hieght should be the same as the hieght of the detail section.
 
A

Allen Browne

If you want to draw a line down the page, regardless of how many detail
records there are, use the Line method in the Page event procedure of the
report.

This example prints a red line down the left of the report:

1. Open the report in design view.

2. Open the Properties box.
Ensuring you are looking at the properties of the Report (not of a text
box), click the Events tab.

3. Set the report's On Page property to:
[Event Procedure]

4. Click the Build button (...) beside this.
Access opens the code window.

5. Set up the event procedure like this:

Private Sub Report_Page()
Me.Line (Me.ScaleTop, Me.ScaleLeft)-(Me.ScaleTop, Me.ScaleHeight), vbRed
End Sub
 
K

Krzysztof Pozorek [MVP]

(...)
Insert a line into the detail section. Make the line width = 0cm and the
hieght should be the same as the hieght of the detail section.

But what about CanGrow Property? This method does not work then.
Better to use following code in report's detail section:
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
Dim i As Integer, CRight As Integer, C As Control
For i = 0 To Me.Controls.Count - 1
Set C = Me.Controls(i)
If C.Section = 0 Then
If C.Left + C.Width > CRight Then
CRight = C.Left + C.Width
End If
Me.Line (C.Left, 0)-(C.Left, Me.Section(0).Height * 10)
End If
Next i
Me.Line (CRight, 0)-(CRight, Me.Section(0).Height * 10)
End Sub

K.P.
http://www.access.vis.pl
 
W

Wayne-I-M

Yes - you're right I didn't think of the can grow "stuff". ooops.

:)


--
Wayne
Manchester, England.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top