Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2005

    Unanswered: Creating expandable lines, reports

    Hi guys
    Well I have been once again tearing my hair out trying to figure out how to expand and print a line depending on section breaks.
    I need to print a line to form a border on the left-hand side of the page.
    I have textboxes that "can grow".
    The report then spreads onto the number of pages it needs, depending on the data coming into the textbox.
    Everything seems to be going fine until it gets the last page, and suddenly only prints to half way down the page. I can't figure out why it is doing so. The code is straightforward and straight out of microsoft help.

    I have had a look through Stephen Lebans PrintLines code, but it is just so overly complex. I don't want to start getting into classes here, I just can't believe there isn't a way to force the report to print a line to the end of the page.

    Why o why won't it go the distance and print the line to the end of the page?
    ALL help seriously appreciated!

    Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
              Dim X1 As Single, Y1 As Single
              Dim X2 As Integer, Y2 As Single
              Dim Color As Long
              ' Specify unit of measurement for coordinates on a page...
              Me.ScaleMode = 5 ' Specify that measurement occur in inches.
              ' Set line to print 0 inches from the left margin.
              X1 = 0
              X2 = 0.2917
              ' Set line to print from the top of the detail section
              ' to a maximum height of 22 inches.
              Y1 = 0.5
              Y2 = 22
              Me.DrawWidth = 0.3333 ' Width of the line (in pixels).
              Color = RGB(0, 0, 0)  ' Use black line color.
              ' Draw the line with the Line method.
              Me.Line (X1, Y1)-(X2, Y2), Color
              ' Call me if you get to the last page
              If Me.Page > 6 Then
                MsgBox "6"
             End If
    End Sub

  2. #2
    Join Date
    Apr 2004
    outside the rim
    Instead of drawing a line on the page, try drawing a line in the detail. If you increase your detail size and then fit a line into it accordingly, it should work.

    The last page problem is probably some internal check that doesn't print anything past the end of the report.

    Perhaps this thread will help:

    good luck,

  3. #3
    Join Date
    Nov 2005
    Hi tc
    Yeah I'm already executing the Line() code from within the detail, but it seems to stop before the end of the detail (see attached photo)
    The forum link you posted was actually me aswell! I was originally trying to expand the height of the associated label. Have since scrapped that idea since (almost) getting the Line working. Didn't want to get into messy subreports as all my data was coming from one query, and am in such a rush to get this finished...argh my brain!
    thanks for your help
    Attached Thumbnails Attached Thumbnails report_lastpage_line_cutoff.JPG  

Posting Permissions

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