Report Rectangle - lines

G

Guest

Hi. I'm using code that Duane Hookom shared in the discussion group. The
code draws vertical lines. Very nice!

Next, I'm using Stephen Lebans' report snapshot RTF viewer. Also very nice!
The only thing that doesn't work when exporting the report to RTF (due to a
snapshot viewer limitation) is horizontal lines. So now I'm trying to figure
out how to use code to draw horizontal lines. Stephen indicates that you
must use either the Report Rectangle Tool (which I've used for vertical line)
or by using the Report object Print method.

Yikes! I'd appreciate any help. My report is Landscape, and has thin
vertical lines and "fatter" vertical line. Thanks for your time.
 
G

Guest

I meant to say:
My report is Landscape, and has thin HORIZTONAL lines and "fatter"
HORIZONTAL lines. Thanks.
 
S

Stephen Lebans

Hi Stephanie,
why can't you simply use the Report's Rectangle tool for your Horizontal
lines?

As for the Line method of the report object, it sound like Duane already
posted sample code. It's use if the same for Horizontal lines except the
coordinates change.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
G

Guest

Stephen,
You make it sound (and look) easy! I am kind of terrible at vba and vba for
reports is a special kind of pain. I looked at your printlinesclass, but
given my calendar format, I ended up with many lines that weren't needed.

I'm trying to get a snapshot/RTF of my calendar report. srptPrograms lists
all of my Opportunities. Between each Opportunity, I'd like a thin
horizontal line the width of my detail section which is about 1 3/8".
Currently, I have a drawn line. This report is portrait.

On my rptCalendar, I have vertical lines using the rectangle report tool.
This report is essentially a matirx. 7 days across (vertical lines
separating days, and truth be told, the vertical lines are too long and don't
expand correctly for my needs) and 5 weeks down (thick horizontal line
separating weeks and currently I'm using a drawn line). rptCalendar is
landscape to the max margin (0.5 left and right).
I believe in the near futher (as Opportunities on srptPrograms increase),
I'll have to switch to 11x14" paper.

Duane posted this:
Private Sub Report_Page()

Dim intRects As Integer
Dim intPageHeadHeight As Integer
Dim intPageFootHeight As Integer
Dim intRptHeadHeight As Integer
Dim intLineBottom As Integer
Dim intLeft As Integer
Dim intTop As Integer
On Error GoTo Report_Page_Error
intRptHeadHeight = Me.Section(1).Height
intPageHeadHeight = Me.Section(3).Height
intPageFootHeight = Me.Section(4).Height
'find the y point of the bottom of line
intLineBottom = (11 * 1440) - _
(intPageFootHeight) - _
1440 'replace 1440 with total top and bottom margins
For intRects = 1 To 9
intLeft = Me("Rect" & intRects).Left
intTop = Me("Rect" & intRects).Top
If [Page] = 1 Then
intTop = intTop + intRptHeadHeight
End If
Me.Line (intLeft, intTop)- _
(intLeft, intLineBottom)
Next

On Error GoTo 0
Exit Sub

Report_Page_Error:
Select Case Err
Case 2462 'no page header
intPageHeadHeight = 0
Resume Next
End Select
MsgBox "Error " & Err.Number & " (" & _
Err.Description & ") in procedure " & _
"Report_Page of VBA Document Report_Report1"

End Sub

I'm using this code for vertical lines. The vertical lines work well, but
don't change length as needed (of course, the code above wasn't intended to
do so). I'm tried many iterations to try to get horizontal lines as well,
but keep ending up with variations on vertical.

I'd appreciate any guidance on coding for horizontal lines, length of
vertical and horizontal lines, and paper size. Thanks!
 

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