How do you create continues lines in a subreport after the data

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

Guest

I am working with a report that contains 6 subreports. The each subreport is
considered a column of data on the report. I also have lines under the data
fields to print. If one subreport only has 6 lines to print and the others
had 8 or 10 lines to print, how do I get the lines to continue one after
there is no more data for that subreport. I would like to fill the page with
lines even if there is no data.

Thanks for your help
 
I would print the lines in the On Page event of the main report with code
like:
Private Sub Report_Page()
Dim intRows As Integer
Dim intLoop As Integer
Dim intTopMargin As Integer
intRows = 24
intDetailHeight = Me.Section(0).Height
intTopMargin = 360
Me.FontSize = 16
For intLoop = 0 To intRows
Me.CurrentX = 20
Me.CurrentY = intLoop * intDetailHeight + intTopMargin
Me.Print intLoop + 1
Me.Line (0, intLoop * intDetailHeight + intTopMargin)- _
Step(Me.Width, intDetailHeight), , B
Next
End Sub
 
Duane,

I copied and pasted the code in the main report in the On Page event
section. I received a compile error that reads variable not defined and the
intDetailHeight is highlighted. What do I need to change to fit the code you
sent me?

Thanks,

Robin
 
Oops, can't believe I didn't catch that.
Private Sub Report_Page()
Dim intRows As Integer
Dim intLoop As Integer
Dim intTopMargin As Integer
Dim intDetailHeight as Integer
intRows = 24
intDetailHeight = Me.Section(0).Height
intTopMargin = 360
Me.FontSize = 16
For intLoop = 0 To intRows
Me.CurrentX = 20
Me.CurrentY = intLoop * intDetailHeight + intTopMargin
Me.Print intLoop + 1
Me.Line (0, intLoop * intDetailHeight + intTopMargin)- _
Step(Me.Width, intDetailHeight), , B
Next
End Sub
 
The coding you sent the second time worked great. But I do have one more
request. How do you stop the numbering of the lines?
Thanks,

Robin
 
I also have another question, How do you change the width of the line to
2pt instead of the hairline font.

Thanks,

Robin
 
I have added a couple lines to the code:

Private Sub Report_Page()
Dim intRows As Integer
Dim intLoop As Integer
Dim intTopMargin As Integer
Dim intDetailHeight as Integer
intRows = 24
intDetailHeight = Me.Section(0).Height
intTopMargin = 360
Me.FontSize = 16
'set the DrawWidth of the line
Me.DrawWidth = 4
For intLoop = 0 To intRows
Me.CurrentX = 20
Me.CurrentY = intLoop * intDetailHeight + intTopMargin
'next line is commented out to stop the numbering
'Me.Print intLoop + 1
Me.Line (0, intLoop * intDetailHeight + intTopMargin)- _
Step(Me.Width, intDetailHeight), , B
Next
End Sub
 
Everything is working great. I went on to add vertical lines to your code.
Here is what I added:

Me.DrawWidth = 5
Me.Line (Me.ScaleTop, Me.ScaleLeft)-(Me.ScaleTop, Me.ScaleHeight), vbBlack
Me.Line (Me.ScaleTop + 3200, Me.ScaleLeft)-(Me.ScaleTop + 3200,
Me.ScaleHeight), vbBlack
Me.Line (Me.ScaleTop + 5750, Me.ScaleLeft)-(Me.ScaleTop + 5750,
Me.ScaleHeight), vbBlack


My next question is "How do I set the topmargain and the bottom margin.
On the code that you sent me I changed the code to begin the rows to the
following:

intTopMargin = 2450

This works great. Now since I added veritcal lines how do I set them to
begin at the same spot. I also changed the code to print only 21 rows
instead of 24. This is where I need the vertical lines to stop. Could you
please help me one more time.

Thanks,

Robin
 
The line method uses Line (X1,Y1)-(X2,Y2). You should use the Y1 value to
set the top of the line.
 
I changed the Y1 value and the line starts where I need them. Now the
question is How do I put a stopping pont on the lines? I do not want them to
go all the way down to what the bottom margin is set at. It needs to stop
1.5 inch from the bottom. My bottom margin is set at .25 After this is
fixed I belive my report is finished. I hope

Thanks

Robin
 
Duane,

I am trying to stop the line by changing the Y2 for the bottom of my report.
I put 12960 since 1inch = 1440 twips. I wanted the line to stop 1.5 inch
from the bottom. What number should I be using?

Here is one of the codes that that I am using.

Me.Line (Me.ScaleTop + 3200, Me.ScaleLeft + 1500)-(Me.ScaleTop + 3200,
Me.ScaleHeight +12960), vbBlack

Thanks,

Robin
 
Duane,

Just wanted to let you know that I finally did it. I figured out what I was
doing wrong. The Y2 needs to be - not + I put in - 600 and everything
worked out. Thanks for all your help.

Robin
 
Back
Top