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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Borders on reports

Status
Not open for further replies.

jbento

Technical User
Jul 20, 2001
573
0
0
US
All,
I have a report set in a column format. I have about 10 fields horizontally placed in the detail section.

2 of those fields or from a subreport. One of the subreports is a can grow field.

I would like to somehow have borders around everthing so it looks something like cells in an excel spreadsheet but my problem is the can grow field. When that fields expands the other cells don't expand the border line to look equal to the can grow field.

How do I get all fields to grow with the subreport field which is set to can grow?

I don't think setting all the other fields to can grow will work, because some of the fields would only have one line of data in them.

Can anyone help me?

I would really appreciate it.

Thanks to everyone.

Jerome Benton
JERPAT Web Designs
GOD Is Good All The Time!!!
 
Hi,

To do this you have to draw the lines in the Detail_Print event procedure

The length of the lines are measured in twips (there are 567 twips to a logical centimeter)

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

' Draws a line across the detail
Me.Line (0, 0)-(15518, 0)
' Draws a line down from the beginning of the detail
Me.Line (0, 0)-(0, 14400)
' Draws a line down from 629 of the detail
Me.Line (629, 0)-(629, 14400)
'Draws a line down at the end of the detail
Me.Line (15518, 0)-(15518, 14400)

end sub

with abit of fiddling this should do the job !

good luck
 
I will try this out today and let you know how I come out.

Thank you so much:)

Jerome Benton
JERPAT Web Designs
GOD Is Good All The Time!!!
 
chris153,
I tried typing the first line of your suggestion and the line changed to a red font, alerting me that there is something wrong with the syntax.

Here is the line I typed:

Me.Line (0, 0)-(15518, 0)

Why does that change to red?

Jerome Benton
JERPAT Web Designs
GOD Is Good All The Time!!!
 
Hello,

Try typing these lines before the code :

Me.ScaleMode = 1
Me.DrawWidth = 3

Sorry, I forgot that you had to define the measurements that the lines are measured in.
 
chris153,
It still doesn't work. It turns the code red, and highlights the "-", that's in this line: Me.Line (0, 0)-(15518, 0).

What do we do now?:)

Jerome Benton
JERPAT Web Designs
GOD Is Good All The Time!!!
 
This is the complete code that I used, try copying it directly into your event procedure.

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

Me.ScaleMode = 1
Me.DrawWidth = 3
Me.Line (0, 0)-(15518, 0)
Me.Line (0, 0)-(0, 14400)
Me.Line (629, 0)-(629, 14400)
Me.Line (3975, 0)-(3975, 14400)
Me.Line (4980, 0)-(4980, 14400)
Me.Line (5782, 0)-(5782, 14400)
Me.Line (6406, 0)-(6406, 14400)
Me.Line (7020, 0)-(7020, 14400)
Me.Line (7635, 0)-(7635, 14400)
Me.Line (9570, 0)-(9570, 14400)
Me.Line (11505, 0)-(11505, 14400)
Me.Line (13440, 0)-(13440, 14400)
Me.Line (14626, 0)-(14626, 14400)
Me.Line (15518, 0)-(15518, 14400)

End Sub
 
I borrowed this from a calendar sheet and modified it for use in general. I named my detail fields srpt1, srpt2, etc.) varying the number in the count below. and drawing a new line for every field width added. The lngheight is set as the tallest.


Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
Dim lngHeight As Long 'store the height of tallest control
Dim i As Integer
Dim lngLeft As Long
For i = 1 To 6
'compare heights
If Me("srpt" & i).Height > lngHeight Then
lngHeight = Me("srpt" & i).Height
End If
Next
'add the height of other control
lngHeight = lngHeight
'draw the lines
lngLeft = Me.srpt1.Width
Me.Line (lngLeft, 0)-(lngLeft, lngHeight)
lngLeft = Me.srpt1.Width + Me.srpt2.Width
Me.Line (lngLeft, 0)-(lngLeft, lngHeight)
lngLeft = Me.srpt1.Width + Me.srpt2.Width + Me.srpt3.Width
Me.Line (lngLeft, 0)-(lngLeft, lngHeight)
lngLeft = Me.srpt1.Width + Me.srpt2.Width + Me.srpt3.Width + Me.srpt4.Width
Me.Line (lngLeft, 0)-(lngLeft, lngHeight)
lngLeft = Me.srpt1.Width + Me.srpt2.Width + Me.srpt3.Width + Me.srpt4.Width + Me.srpt5.Width
Me.Line (lngLeft, 0)-(lngLeft, lngHeight)
lngLeft = Me.srpt1.Width + Me.srpt2.Width + Me.srpt3.Width + Me.srpt4.Width + Me.srpt5.Width + Me.srpt6.Width
Me.Line (lngLeft, 0)-(lngLeft, lngHeight)
Me.Line (0, lngHeight)-(lngLeft, lngHeight)
Me.Line (0, 0)-(0, lngLeft)

End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top