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!

Need help with a verticle line in an Access Report 2

Status
Not open for further replies.

KHerm

Programmer
Jan 9, 2001
80
0
0
US
Is there a way to get a verticle line on an Access Report that will cross the groups? Or do I really have to put a verticle line in each group and line them up? I know I can use the format "left" "width" "height" values but every time I change spacing for the groups, the report looks bad again. And I keep thinking this should be easier.

Thanks for any help.

Ken
 
Unfortunately this issue is not easy at all. You should place the lines only once you have finished your report design.
 
hi,

since the subject is on: is there a way to extend a vertical line in the DETAIL section down to the PAGEFOOTER section even when say only the first 2 lines of 15 possible lines are actually used detail-records?

it's been bugging me for quite a while, but I never found any solution.

greetings

the kid
 
Thanks, Francescina. That wasn't what I wanted to hear (but I expected it). The info is helpful indeed!

Ken
 
KHerm, CPUBurn

From the "Access Advisor" magazine (July 1996)

"Use the Line Method. Create an OnPrint event procedure for the detail section of the report and explicitly draw vertical lines where appropriate. You can use each field's Left property, and the report's GridX property to figure out where to draw each line:

Code:
Sub Detail1_Print (Cancel as Integer, PrintCount as Integer)
Dim X1 as Single
Dim Offset as Single

Offset = 1440/Me.GridX    'Convert GridX to twips
X1 = [Subject].Left - Offset  'Compute X1 in twips
Me.Line (X1, 0) - (X1, 10,000) 'Draw Line with clipping
End Sub

Access will clip the line height to fit the detail section."

This won't draw lines across the Sections, but it should work in each section.

HTH

Lightning
 
Wish I would have known about this forum when I was having troubles with printing verticle lines on my reports. My problem was text boxes that grew (they were never the same size). After asking at another forum many times, I finally got a solution that worked.

Nice to know that questions are answered quickly!! lena.wood@wgint.com (work)
ellefant@bossig.com (home)
 
I have been trying to use the Line function during the OnPage event to draw a vertical line from the beginning of Detail down to PageFooter. When I try to capture the TOP of Pagefooter (bottom of my line), I get a number that is below where the actual top of the footer is (about two lines below). I am trying to capture it at the OnFormat event of PageFooter. Does anyone have any ideas about this.
 
This was somewhat discussed a while back. The following is my contribution to being able to place vertical lines the entire HEIGHT of the detail section of a FORM. With some elaboration, the process could be adapted to do each section of a form / report. You would need to have a list of controls where the vertical lines were desired (assume some set of controls in the detail section). For the FIEST pass of the detail section, let MyCords "capture" the horizontal position of the line(s). For each subsquent section where the lines were desired, use the Positions developed in the forst pass through the detail section be an argument to a similar routine, which draws the lines through that section.

Overall, it would be some additional work to set up, but once organized, you shouldn't have to adjust the vertical lines when you modify the report. Of course, this WILL be somewhat of a resource HOG for a production process - but then the processors keep getiing FASTER.

Code:
Public Function BasVertLn(Form As String, MyCtrl As String, _
                          Optional LR As Boolean = True) As String

    'Michael Red, 12/1/2001
    'Draw a Vertical Line Beside a Controls on a Report
    'where the control's Properties CanGrow and CanShrink may be TRUE

    Dim X1 As Double        'Left
    Dim Y1 As Double        'Top
    Dim X2 As Double        'Right
    Dim Y2 As Double        'Bottom
    Dim Offset As Long      'Border / Whitspace Width
    Dim LnColor As Double   'Line color to Draw

    Offset = 35

    'Must be CALED from OnPrint Event of Report. Similar to:

    'Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
    '    MyCoords = basVarBox(Me.name, Expression.name, False) Lines to RIGHT
    'End Sub

'                               -OR-

    'Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
    '    MyCoords = basVarBox(Me.name, Expression.name, True) Lines to LEFT
    'End Sub

    'Where:
    '   MyCoords is a Dummy (String) variable
    '   Me.Name is a constant (returns the Name of the REPORT)
    '   Expression(.Name) is the "name" of the Controls.

    'Left X  (Min of Left of the Control)
    X1 = Reports(Form).Controls(MyCtrl).Left
    X1 = X1 - Offset

    'Right X  (Max of Left + Width of the Controls)
    X2 = Reports(Form).Controls(MyCtrl).Left + Reports(Form).Controls(MyCtrl).Width
    X2 = X2 + Offset

    'Top Y  (Min of Top of the Controls)
    Y1 = Reports(Form).Controls(MyCtrl).Top
    Y1 = Y1 - Offset

    'Bottom Y (Max of Top + Height of the Controls)
    Y2 = Reports(Form).Controls(MyCtrl).Top + Reports(Form).Controls(MyCtrl).height
    Y2 = Y2 + Offset

    Select Case LR

        Case Is = True
            Reports(Form).Line (X1, Y1)-(X1, Y2), LnColor

        Case Is = False
            Reports(Form).Line (X2, Y1)-(X2, Y2), LnColor

    End Select

End Function
MichaelRed
m.red@att.net

There is never time to do it right but there is always time to do it over
 
Michael, Thanks for your reply. I understand what you have described here. But I don't see how it can extend lines down past the last detail line, all the way down to the PageFooter. It looks like this would stop after the last detail was printed and then the footer would be down at the bottom of the page. I am trying to produce an Invoice with vertical lines filling the detail area even after the detail lines have ended. Can you give me another push in that direction?

Wayne
 
THIS routine only would do the detail section. If, on the FIRST call to this, you saved the X-Pos of each vertical line in a common (to the form/report) area (use an array?), you would have the positions for each line in each following section. Another procedure, quite similar to this one, could use the (saved) xPos of each line to draw another set of lines the full height of the section. Another 'soloution' could be used -providing the following sections had controls aligned and sized the same ass the detail, just call the same routine with the names of hte corresponding controls at each section. To me, it appears to be not different. You will always need to line up hte controls from the detail section to each (additional) section for the vertical lines to 'make sense' anyway, so the same approach should work throughout the sections where you want the column demarcation.

MichaelRed
m.red@att.net

There is never time to do it right but there is always time to do it over
 
I do not have a problem with X (column demarcation), I have a problem with Y (the length of the lines). I cannot accurately determine the TOP property of the PageFooter section. Repeating lines for the HEIGHT of each DETAIL line do not continue down to the footer if the details do not fill up the page.

At the OnFormat event for the Pagefooter, the TOP property is returning a number that is below the actual top of the section. Therefore, me lines are extending down into the footer area. Could it be influenced by the page margins(top)?
 
I think we are 'discussing' this at cross purposes. To begin with, I have never suggested the use of the 'on format' event, but always suggest the 'on print' event. Secondly, I did NOT propose a problem/soloution for the width of the line(s), only a use of the POSITION as one way to locate the line segments in subsquent sessions.

Sine this appears to be a burden to both of us, I will leave the discussion to others who MAY be able to communicate with you more easily.


MichaelRed
m.red@att.net

There is never time to do it right but there is always time to do it over
 
Sorry Michael. I didn't intend for this to turn into an argument. Maybe I should have started a new thread since this thread seems to be a discussion about the POSITION of the lines as opposed to the LENGTH of the lines which I am concerned with. It seems like I'm having a hard time getting that point across in this thread.
 
Hi everyone,

Here's a follow-up to my previous message: I thought I'd just post the code; it's so little. In the Page event for the report, enter the following code:

With Me
Me.Line ((0), 1)-(0, .ScaleHeight - (.Section(acPageFooter).Height))
End With

That's all!
(took me ages to find out, though!)

Greetings again,
Keimpe
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top