I have many reports that list students by teacher, by class, by grade, etc.
Each report has detail footers that depend on the grouping. I want to give
the user to option to print any number of extra lines to add additional
students in each group. So depending on the report my "extra" lines at the
end of each group can be anywhere on the page depending on what else is
printed on the page. I been saying that 1/2 of the box prints on one page
and the second half prints on the next page, well it can be any part of a box
(1/2, 1/3, 1/4 or any other part of a box), it just depends where the data on
the page ends. Maybe there is no solution for this problem and I'll just
have to live with the partial boxes.
Even if I draw a constant number of boxes the same thing will happen if the
group footer is at the end of the page...
Is there a variable that tells one how far down they are on a page? I think
from your last response you said no, but I'm not sure. If there is and if
there is a command for a Page Break I think I could solve my problem.
Thanks again
Duane Hookom said:
I don't know how to determine where you are on the page. When I use code to
draw boxes, I use the On Page to draw a constant number of boxes.
--
Duane Hookom
MS Access MVP
--
Phil said:
Hi again,
It's working just like any page break (top of form) of a report. If the
report is near the bottom of the page and I print 10 extra sets of boxes
using the On Form event of the detail footer and there is only room for 4
1/2
boxes at the bottom of the page, the 4 1/2 boxes print at the bottom of
the
page and the other 5 1/2 print on the top of the next page and the report
continues on with the next detail section.
Do you know of any way to tell if the report is near the end of a page so
I
could force a page break (if that's possible) in my Do While Loop before
the
half box prints?
Thanks,
Phil
:
I wouldn't know what causes the lines on the second page. I wasn't aware
that code running in one page would cause drawn stuff on other pages.
--
Duane Hookom
MS Access MVP
Thanks Duane, I have it working with the following code:
Private Sub GroupFooter1_Print(Cancel As Integer, PrintCount As
Integer)
Dim sngTop As Long
Dim rpt As Report
Dim intx As Integer
Set rpt = Reports![by teacher / grade]
intx = 0
Do While (intx <> [Forms]![Report Menu]![ExtraLines])
sngTop = rpt.ScaleTop + (70 * intx)
DrawData (sngTop)
Me.DrawWidth = 2
rpt.Line (23, sngTop)-(460, sngTop + 70), lngColor, B
intx = intx + 1
Loop
End Sub
[ExtraLines] comes from a text box on the form that calls the report
DataDraw draws a row of formated boxes based on selectons made on the
calling form.
rpt.line draws one extra box that is not part of DataDraw
The problem I have now: based on data in the report the set of boxes
at
the
bottom of the page may (or may not) be part on the bottom of one page
and
the
rest on top of the next page. In other words, the top part of the
boxes
are
on one page and the bottom part on the next page. Do you know of a
way
to
prevent this. Is there a way to force a page break in the "on page"
event
or
another soluton?
What I have working is just what I need if I can solve this problem.
Thanks again,
:
You can create a constant number of lines and "other characters" on
each
page with some code in the On Page event. Example to print 24
numbered
rectangles:
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 Hookom
MS Access MVP
Hi,
I have a report that list student information and each detail line
has
formatting consisting of a horizontal line and other characters
that
are
not
part of the records. Of course when the records run out the
detail
section
ends. Is there a way to continue the detail section formatting
after
there
are no more records? I would like the formatting to continue (say
5-10
more
areas or to the end of the page) so that there are places on the
report
for
the teacher to hand enter new students. I don't think this can be
done,
but
I thought I would ask. Maybe with a 'do while' loop in the detail
footer?
Thanks,
Phil