Drawing vertical lines in the detail section

S

Stefan Hoffmann

hi,

i have Line controls on my report to seperate my columns. I'm trying to
use the Report.Line method in the print event to extend the lines as
i've got autosizing textboxes on my report. The code so far:

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

Dim ctl As Access.Control

For Each ctl In Me.Controls
If TypeOf ctl Is Line Then
Me.Line (0, ctl.Left)-(ctl.Width, 100000), 0
End If
Next ctl

My problem is the correct use of Report.Line. It is now drawing the
lines always at the left side of my report.

Any hints out there?

mfG
--> stefan <--
 
M

Marshall Barton

Stefan said:
i have Line controls on my report to seperate my columns. I'm trying to
use the Report.Line method in the print event to extend the lines as
i've got autosizing textboxes on my report. The code so far:

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

Dim ctl As Access.Control

For Each ctl In Me.Controls
If TypeOf ctl Is Line Then
Me.Line (0, ctl.Left)-(ctl.Width, 100000), 0
End If
Next ctl

My problem is the correct use of Report.Line. It is now drawing the
lines always at the left side of my report.


The coordinates for the line are relative to the section,
and in X,Y order:

Me.Line (ctl.Left, 0)-Step(ctl.Width, 100000), 0
 
S

Stefan Hoffmann

hi Marshall,

Marshall said:
The coordinates for the line are relative to the section,
and in X,Y order:
Me.Line (ctl.Left, 0)-Step(ctl.Width, 100000), 0
Thanks.

The following code now draws the "autosized" vertical lines:


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

Dim ctl As Access.Control

For Each ctl In Me.Controls
If TypeOf ctl Is Line Then
Me.Line (ctl.Left, 0)-(ctl.Left, 1000000), 0
End If
Next ctl

End Sub


mfG
--> stefan <--
 
M

Marshall Barton

Stefan said:
The following code now draws the "autosized" vertical lines:

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

Dim ctl As Access.Control

For Each ctl In Me.Controls
If TypeOf ctl Is Line Then
Me.Line (ctl.Left, 0)-(ctl.Left, 1000000), 0
End If
Next ctl

End Sub


Glad you straightened it out. I guess I gave you the
coordinates for drawing a rectangle without specifying the
rest of the arguments??

Note that it may be clearer/simpler(?) to use Step so you
can make the second set of coordinates relative to the first
set:
Me.Line (ctl.Left, 0)-Step(0, 32000), 0

Also note that your line length of 1,000,000 twips is way
beyond the maximum size of a section (22 inches). I
thought(?) that value was an Integer that can not be greater
than 32,767 and exceeding the limit may not do what's
expected.
 
S

Stefan Hoffmann

hi Marshall,

Glad you straightened it out. I guess I gave you the
coordinates for drawing a rectangle without specifying the
rest of the arguments??
I've taken the example from the OH without thinking about it.
Note that it may be clearer/simpler(?) to use Step [..]
It's the same for me, so i'm using the style i'm used to.
Also note that your line length of 1,000,000 twips is way
beyond the maximum size of a section (22 inches).
I've read somewhere (maybe in the OH), if the size is greater then the
section height that the section height is used instead of the given value.
Why it doesn't bail out? Don't know either.

mfG
--> stefan <--
 

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