Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to create grid lines on report detail line ?? 1

Status
Not open for further replies.

Dylan

MIS
Aug 27, 1998
109
US
Hello all,
I have a report that I need to create that needs solid gridlines around all of the detail line fields that I need to print.

Any help with this would be greatly appreciated ...

Thanks Tom



Tom Moran
Lansing, Michigan
 
Would setting a border round the controls give the effect you need?

Open the properties window of a text box, and look on the [Format] tab. Set:

Border style = Solid
Border color = 0
Border width = Hairline

If this creates the effect you need, use the format painter to copy this format to the other objects in the Details section.

You can vary the colour and width to get different effects.


Bob Stubbs
 
HI bob,

Actually the report will have many areas that do not have flds. Only a few of the columns will contain data.



Tom Moran
Lansing, Michigan
 
Try this

Option Compare Database
Option Explicit
Dim lngPage As Long
' this code uses Lines set into the detail section
' that have their Visible property set to False.
' We redraw new lines in the same location that
' are slightly larger than the tallest TextBox
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
Dim sngLineTop As Single
Dim sngLineLeft As Single
Dim sngLineWidth As Single
Dim sngLineHeight As Single
Dim ctl As Control
Dim lngH As Long
'if new page then draw a line at the top of the detail section
If lngPage <> Me.Page Then
Me.Line (0, 0)-Step(Me.Width, 0)
lngPage = Me.Page
End If
'get the height of the tallest TextBox
For Each ctl In Me.Controls
If ctl.ControlType = acTextBox Then
If Me(ctl.Name).Height > lngH Then
lngH = Me(ctl.Name).Height
End If
End If
Next ctl
'draw a new line in the same spot as existing lines
For Each ctl In Me.Controls
If ctl.ControlType = acLine Then
sngLineTop = Me(ctl.Name).Top
'4320 twips equals 3 inches
sngLineLeft = Me(ctl.Name).Left
'20 twips equals approximately 1 point (1/72 inch)
sngLineWidth = Me(ctl.Name).Width
sngLineHeight = 0 + lngH + 10
Me.Line (sngLineLeft, sngLineTop)-Step(sngLineWidth, sngLineHeight)
End If
Next ctl
'draw a line at the bottom of the Detail Section
sngLineTop = lngH + 10
sngLineLeft = 0
sngLineWidth = Me.Width
sngLineHeight = 0
Me.Line (sngLineLeft, sngLineTop)-Step(sngLineWidth, sngLineHeight)
End Sub

PaulF
 
where should the code be placed ???

Tom Moran
Lansing, Michigan
 
goes in the code window behind the report. You have to place vertical lines on the report in the detail section where you want them, then set their visible property to false .. and then open the report, and you should have gridlines.

PaulF
 
Thanks Paul

I now have the horiz lines on report (in preview) but when I print the report they are not visable. ???


Tom Moran
Lansing, Michigan
 
Paul,

I fixed it by dragging the bottom of the detail line down a nothc.

Thanks for your help !!!!

Tom Moran
Lansing, Michigan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top