Page 1 of 2 12 LastLast
Results 1 to 15 of 18
  1. #1
    5 Star Lounger
    Join Date
    Jan 2005
    Posts
    614
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Draw Line (Access2000-03)

    I've asked this before but I had not understood how to proceed and I am trying again.
    Attached is the SUB Report that contains 5 SUB Reports and all of it is the quarter of the Report.
    I need to have a line at the very left of this Report that will expand with Report.
    I did not get DrawLine method mostly because I was not sure what event is to write it on.

    Is there easier way of DrawLine is the only one?
    Thanks

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Draw Line (Access2000-03)

    I don't see an attachment... <img src=/S/scratch.gif border=0 alt=scratch width=25 height=29>

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Draw Line (Access2000-03)

    I have pointed you to <post:=143,705>post 143,705</post:> before. It explains in detail how to use the DrawLines function.

  4. #4
    5 Star Lounger
    Join Date
    Jan 2005
    Posts
    614
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Draw Line (Access2000-03)

    Well, I did it again. It seems running but wouldn't show.
    Sorry forgot the attachment. I need it right at the left position 0.001 or something.
    Thanks


    I am seeing xPos=o.1 (I had entered it) and Inch=Empty and MaxHeight=22 (you entered it)...so it does reading code...
    Sub DrawLines(R As Report, ParamArray xPos())
    ... R.Line (xPos(i) * Inch, 0)-(xPos(i) * Inch, MaxHeight * Inch)
    Next i
    End Sub
    Attached Files Attached Files

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Draw Line (Access2000-03)

    The code from <post:=143,705>post 143,705</post:> assumed that the lines should be drawn in the Detail section of the report. From your screenshot it appears that the subreports are not in the detail section, but we can't see in which section. However, you should call DrawLines in the On Print event of the section that contains the subreports instead of in the Detail section.

  6. #6
    5 Star Lounger
    Join Date
    Jan 2005
    Posts
    614
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Draw Line (Access2000-03)

    I did - I am calling from GroupHeader0 - on Print!

  7. #7
    5 Star Lounger
    Join Date
    Jan 2005
    Posts
    614
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Draw Line (Access2000-03)

    One more tey.
    Is the Inch suppose to be populated with something rather than being =Empty?
    If so - how do I get this done?
    I need my line to be drawn at 4 inches from the left.

    I want to ask if this part
    ' Number of twips in one inch.
    Const OneInch = 1440
    ' Maximum height of a section in inches.
    Const MaxHeight = 22

    requires some adjustment. What is Const OneInch?
    Thanks

  8. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Draw Line (Access2000-03)

    I'm terribly sorry, I see that I made a mistake in the DrawLines procedure in <post:=143,705>post 143,705</post:>: I declared a constant OneInch, then used Inch instead of OneInch. <img src=/S/blush.gif border=0 alt=blush width=15 height=15>

    Here is the correct version:

    Sub DrawLines(R As Report, ParamArray xPos())
    ' Number of twips in one inch.
    Const OneInch = 1440
    ' Maximum height of a section in inches.
    Const MaxHeight = 22
    ' Loop index
    Dim i As Integer
    ' Draw vertical line at xPos(i) inches from left margin. Covers entire section.
    For i = LBound(xPos) To UBound(xPos)
    R.Line (xPos(i) * OneInch, 0)-(xPos(i) * OneInch, MaxHeight * OneInch)
    Next i
    End Sub

  9. #9
    5 Star Lounger
    Join Date
    Jan 2005
    Posts
    614
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Draw Line (Access2000-03)

    OMG! I've changed Inch to OneInch and drew the line across my section but not the straight one - sort of like a slash..
    R.Line (xPos(i) * Inch, 0)-(xPos(i) * Inch, MaxHeight * Inch)
    to
    R.Line (xPos(i) * oneInch, 0)-(xPos(i) * Inch, MaxHeight * oneInch)

    Thanks and please, comment

  10. #10
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Draw Line (Access2000-03)

    There's one instance of Inch left. You should change that to OneInch too:

    R.Line (xPos(i) * oneInch, 0)-(xPos(i) * oneInch, MaxHeight * oneInch)

  11. #11
    5 Star Lounger
    Join Date
    Jan 2005
    Posts
    614
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Draw Line (Access2000-03)

    So...you was wrong? LOL
    You never said we should replace Inch with OneInch...HAHA I got you!!!!

    My line is straight now! Thanks! WOW!

    NOW...it is not that easy! Can I have this beautifull line to start where I want it to start instead of the top of the section and end where I want it to end? Please, do not hate me...

  12. #12
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Draw Line (Access2000-03)

    I posted the correct code in <post:=705,669>post 705,669</post:>

    I don't have time for your other question now. Later...

  13. #13
    5 Star Lounger
    Join Date
    Jan 2005
    Posts
    614
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Draw Line (Access2000-03)

    I am so happy I have my Line now.

    Nevermind other question - I can insert another GroupHeader and move all I need to separate in there. Right? Thanks so much!

  14. #14
    5 Star Lounger
    Join Date
    Jan 2005
    Posts
    614
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Draw Line (Access2000-03)

    Exuse me - how to make a line width wider? Thanks

  15. #15
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Draw Line (Access2000-03)

    The 0 in R.Line (xPos(i) * OneInch, 0)-(xPos(i) * OneInch, MaxHeight * OneInch) is the vertical starting point for the line, 0 meaning right at the top of the section. You can change 0 to (for example) 0.15 * OneInch if you want to start 0.15 inch from the top.
    Determining where the line ends is difficult because you don't know how high the section is when printed.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •