By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,688 Members | 1,860 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,688 IT Pros & Developers. It's quick & easy.

Blank Lines In Reports

P: n/a
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
Nov 13 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Melissa wrote:
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.

Nov 13 '05 #2

P: n/a
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

"Melissa" <mb****@earthlink.net> wrote in message
news:1p***************@newsread2.news.atl.earthlin k.net...
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

Nov 13 '05 #3

P: n/a
Ed,

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

Thanks!

Melissa
"Ed Robichaud" <ed*********@wdn.com> wrote in message
news:F2*******************@newshog.newsread.com...
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

"Melissa" <mb****@earthlink.net> wrote in message
news:1p***************@newsread2.news.atl.earthlin k.net...
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


Nov 13 '05 #4

P: n/a
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

--
Duane Hookom
MS Access MVP
"Melissa" <mb****@earthlink.net> wrote in message
news:1p***************@newsread2.news.atl.earthlin k.net...
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

Nov 13 '05 #5

P: n/a
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
"Duane Hookom" <duanehookom@NO_SPAMhotmail.com> wrote in message
news:Oi**************@TK2MSFTNGP14.phx.gbl...
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

--
Duane Hookom
MS Access MVP
"Melissa" <mb****@earthlink.net> wrote in message
news:1p***************@newsread2.news.atl.earthlin k.net...
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


Nov 13 '05 #6

P: n/a
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.

--
Duane Hookom
MS Access MVP
"Melissa" <mb****@earthlink.net> wrote in message
news:yh***************@newsread2.news.atl.earthlin k.net...
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
"Duane Hookom" <duanehookom@NO_SPAMhotmail.com> wrote in message
news:Oi**************@TK2MSFTNGP14.phx.gbl...
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

--
Duane Hookom
MS Access MVP
"Melissa" <mb****@earthlink.net> wrote in message
news:1p***************@newsread2.news.atl.earthlin k.net...
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



Nov 13 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.