How to use Lineslant property in the report

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

My requirement is to draw a line Upper Right to Lower left -

Line to be started at : Exactly from the place where the detail section Ends

Line to End at : It should end exactly where the PageFooter starts

I posted related to same earlier, could not find any reply. While finding I
seached in the help file about LINESLANTING - I tried to use. But failed.

Please note the following :
Actually I am preparing a report for delivery note, where the following
heights are there:
Report Header
Groupsection/level - only one
Detail section - which expands or retracts according to number to records
Pagerfooter - where the total fields is there

Now I have been asked to draw a slanting line from upperRight to LowerLeft
starting from the point where the detail section ends and it should end
exactly where the pagefooter starts. Just to show that there is nothing
inbetween these spaces.

Please advise.

Regards.

Irshad
 
Use the Page event procedure of the report to draw the line using the Line
method.

You will need a variable to track where the last Detail section of the page
was placed.

1. In the General Declarations section of the report's module (at the top,
with the option statements):
Private mlngDetailBottom As Long

2. In the Print event of the Detail section, record where the report's Top
property is:
mlngDetailBottom = Me.Top + Me.Section(acDetail).Height

3. In the Page event, you can now use the Line method to draw a line from
mlngDetailBottom to the location at the top of the page footer.

Use Me.ScaleHeight to determine the available height of the report
(excluding top and bottom margins.) Subtract mlngDetailBottom, and also
Reports(0).Section(acPageFooter).Height.

Use Me.ScaleLeft and Me.ScaleWidth to determine the horizontal width.

(Haven't tested it,but that should work.)
 
Thanks for your reply.

I tried the below code with little adjustment, It works from UpperLeft To
LowerRight, But my requirement is from UpperRight To LowerLeft.

Only the direction is the problem, Rest is Ok.

Option Compare Database
Private mlngDetailBottom As Long

Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
mlngDetailBottom = (Me.top + Me.Section(acDetail).Height) - 700
End Sub

Private Sub Report_Page()
Me.ForeColor = vbRed
Me.DrawWidth = 5
Me.Line (Me.ScaleLeft, mlngDetailBottom)-Step(Me.ScaleWidth, Me.ScaleHeight
- (mlngDetailBottom + Reports(0).Section(acPageFooter).Height))
End Sub


I tried to correct but failed. Just correct my code so that it can draw a
line from UpperRight to LowerLeft.

Best regards.

Irshad
 
Back
Top