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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Vertical lines 1

Status
Not open for further replies.

Olifour

Technical User
Mar 6, 2002
12
0
0
FR
I need to draw vertical lines in the Onpage event of the report in order to have vertical lines throuh any blank lines beyond last detail section on a page to the top of the page footer. I have already the codes which draw those vertical lines in section detail (through the detail print event).

So in the Onpage event, I need those vertical lines to continue till the top of the page footer.

Private Sub Report_Page()
With Me
Me.line((.left+.Width+intlineMargin) ,A) -_ (.left+.Width+intlineMargin) ,B)
End With

End Sub

Apparently "B" could be "ScaleHeight - (.Section(acPageFooter).Height" but I am not sure it will works in all cases.

Further more, I don't know how to identify "A". It could be Line173 in a groupheader. It could be also the bottom of section detail (if there are already the vertical lines for this section). Both are possible.

I appreciate the time you take to listen my approximation, but effectively, this is important to find the solution.

Would you accept me to send you per mail the sample of my little data base in order you can test the report concerned. In this case, I would need your e-mail address.

Thks. Rgds.
 
Try putting a variable in your report to hold the "bottom" (A) coordinate of your last detail section. For example:
Code:
Dim lngBodyHeight As Long

Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
  lngBodyHeight = Me.Top + Me.Height
End Sub

Private Sub GroupHeader0_Print(Cancel As Integer, PrintCount As Integer)
  lngBodyHeight = Me.Line173.Top
End Sub

Private Sub Report_Page()
  Me.Line ((.left+.Width+intlineMargin) ,lngBodyHeight) - _ Step(0 ,ScaleHeight - (.Section(acPageFooter).Height) - lngBodyHeight)
End Sub
Notice the "Step" option in the second part of the Line statement. That option causes the line to be drawn relative to the starting point given in the first part of the statement, not relative to the top of the page as when the "Step" is omitted. The "Step" thus uses "0" for a relative "left" offset.
 
Here's a better version of my earlier response. The variables should technically be singles, not longs.
Code:
Dim sngBodyHeight    As Single
Dim sngPageHeaderTop As Single
Dim sngPageFooterTop As Single

Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
  sngBodyHeight = Me.Top + Me.Height
End Sub

Private Sub GroupHeader0_Print(Cancel As Integer, PrintCount As Integer)
  sngBodyHeight = Me.Top + Me.Height
End Sub

Private Sub PageFooterSection_Print(Cancel As Integer, PrintCount As Integer)
  sngPageFooterTop = Me.Top
End Sub

Private Sub PageHeaderSection_Print(Cancel As Integer, PrintCount As Integer)
  sngPageHeaderTop = Me.Top
  sngBodyHeight = Me.Top + Me.Height
End Sub

Private Sub Report_Page()
  Me.Line ((.left+.Width+intlineMargin) , sngBodyHeight - sngPageHeaderTop) _
        -Step(0, sngPageFooterTop - sngBodyHeight)
End Sub
 
We can not apparently attach files on this forum. I appreciate your two messages, but I still do not find the solution, even with your second proposal.

Can you send me an e-mail on ofassoso2@hotmail.com so that I can send to you the mdb. file. So you could really adapt your proposal and could try to change directly my codes in the report concerned.

I would really appreciate

Thks. Rgds.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top