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

Add lines at end of a report

Status
Not open for further replies.

zrzr

Programmer
May 22, 2003
83
FR
Hi !!!!

I'm designing a report based on a query.
The report looks like this

Header
__________________
line 1
__________________
line 2
__________________
...
__________________
line 24
__________________
line 25
__________________
footer

Each lines represents a record in the query, but thera can be less than 25 record ! In this case, I would like to display blank lines, which will be added "manually" after printing.

How can I do That ????
 
The easiest way I can think of is to maybe put the lines you are printing into a temporary table, then add blank entries until the total records in the table is a multiple of 25.

You may be able to do something in the footer OnFormat event, but it will probably take you many hours of messing around!
 
Use code in the On Page event of the report to draw all lines using the Line method.
Private Sub Report_Page()
Dim intLineCount As Integer
Dim intLines As Integer
Dim intLineSpacing As Integer
Dim intTopMargin As Integer
Dim intYPos As Integer

intLines = 25
intTopMargin = 720 'half inch
intLineSpacing = Me.Detail.Height
For intLineCount = 1 To intLines
intYPos = (intLineCount * intLineSpacing) + _
intTopMargin
Me.Line (0, intYPos)- _
Step(Me.Width, 0)
Next
End Sub
 
Thanks dhookom, but I used Norris68 method. It is probably a bit slower, but it's very easier to obtain a "good" result.

So, is someone want to know how I did, this is the process I used :

1. Create a temporary table
2. Copy all data from the query to the table
3. Count how many line to add
4. Add lines to obtain a multiple of 25
5. Base the report Recordsource on "temp table"

So, thanks Norris68 to put me on the good way !!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top