Blank Lines In Reports

M

Melissa

Does anyone have a generic procedure for adding blank lines to reports like
Sales details, PO details and/or Orders details. The procedure would need to
count the number of line items, determine the remaining page to fill and
print blank lines with the same number of fields as the line items. In
addition, if there were a long list of line items that carried over to a
second and possibly more pages, to print blank lines at the last page. The
available page length would be more after the first page.

And as a wrench in the works, say an orders report is for several customers
and the report page breaks at the end of each customer, the procedure would
need to print blank lines after each customer.

Thank you very much!

Melissa
 
S

Salad

Melissa said:
Does anyone have a generic procedure for adding blank lines to reports like
Sales details, PO details and/or Orders details. The procedure would need to
count the number of line items, determine the remaining page to fill and
print blank lines with the same number of fields as the line items. In
addition, if there were a long list of line items that carried over to a
second and possibly more pages, to print blank lines at the last page. The
available page length would be more after the first page.

And as a wrench in the works, say an orders report is for several customers
and the report page breaks at the end of each customer, the procedure would
need to print blank lines after each customer.

Thank you very much!

Melissa

Do you know how to program VBA? Or are you a macro coder?

If you are a programmer utilizing VBA, please look at
MoveLayout/MoveNext/PrintSecion in on-line help.

You might want to create a running sum variable that is reset on page
breaks or something like that. Increment the variable for each detail
line. Then run a loop.

Here is an example. It will not do what you want but it should provide
some info. I created a field called MoveCount and it is in the
GroupHeader0 band.

Private Sub GroupHeader0_Format(Cancel As Integer, _
FormatCount As Integer)

'intCount is a global variable for the report
If Me.MoveCount < intLineCnt Then
'I want to move to the next line until
'I can start printing. This report prints
'from the middle of the page to the bottom
'so I need to calc when to start printing
'but not overflow to the next page.
Me.MoveLayout = True
Me.PrintSection = False
Me.NextRecord = False
Me.MoveCount = Nz(Me.MoveCount, 0) + 1
Else
Me.MoveLayout = True
Me.PrintSection = True
Me.NextRecord = True
End If
End Sub

Private Sub PageHeader_Format(Cancel As Integer, FormatCount As Integer)
Me.MoveCount = 0
Dim rst As Recordset
Dim strSQL As String
Dim lngWidth As Long
Dim lngHeight As Long
Dim lngTotalLines As Long
Dim lngRet As Long

'get the number of records to print on this page
intRecCnt = GetRecCount()

If Me.Notes > "" Then
'get the number of lines it will take to
'print a memo field. This is a Stephan
'Lebans routine found at his web page.
lngRet = fTextHeight(Me.Notes, , _
lngHeight, lngWidth, lngTotalLines)
intNotes = lngTotalLines
End If

'used to calc where to start printing on a page
intLineCnt = 31 - intNotes - (intRecCnt + 1)

End Sub


If you are not a programmer...grin...now's a good time to start.
 
E

Ed Robichaud

I think that you would have a quicker and easier solution to your request if
you used the page and report header/footers to format your invoices, rather
than trying to pad the detail section with blank lines.
-Ed
 
M

Melissa

Ed,

Thank you for the recommendation. Any suggestion on how to do it?

Thanks!

Melissa
 
D

Duane Hookom

You can print lines or rectangles in the On Page event of the report. The
following code will print 25 numbered lines on a page regardless of the
number of records on the page.

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
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
 
M

Melissa

Duane,

Thank you for responding! This might be able to be adapted into the
solution. I need to be able to determine how many records are on each page.
Any idea how to do that? Then I need to fill the remaining page with blank
lines.

Melissa
 
D

Duane Hookom

I don't know how to determine this unless you have a set number of records
on each page (can't grow). This might also depend if each group begins on a
new page.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top