Hi All:
I have a main report that calls a sub-report. The sub-report is sorted by
MemberID. The MemberID Footer Section of the sub-report prints a Totals
line. The Detail Section of the sub-report prints detail records.
Typically if the detail records does not fill up the entire page, then the
Totals line is printed immediately after the last detail record. What I
want to do is to continue to print "dummy" records repeatedly after the last
detail record so that the Totals line is printed at the bottom of the page
instead of immediately after the last detail record.
I have created a second MemberID Footer section which contains an empty
textbox and which has the codes to print repeatedly the textbox as "dummy"
records. The layout of the sub-report is as follows:
Detail Section - Prints the detail records.
MemberID Footer #1 - Prints the dummy records repeatedly ( if necessary ).
MemberID Footer #2 - Prints the Totals line.
These are the codes in the "On_Print" event procedure of MemberID Footer #1:
NOTE:
gRowCounter = Keeps track of the number of detail lines printed.
gLINEFILLER = Declared as Const (example 36).
If the number of detail lines printed is less than gLINEFILLER, then the
dummy records will be printed repeatedly in order to pad the empty spaces.
'************************************************* ****
'* Add filler rows to pad the page's blank spaces.
'************************************************* ****
If gRowCounter < gLINEFILLER Then
gRowCounter = gRowCounter + 1
Me.NextRecord = False
Me.MoveLayout = True
Me.PrintSection = True
Else
'************************
'* Reset the parameters.
'************************
Me.NextRecord = True
Me.MoveLayout = False
Me.PrintSection = False
End If
Here is the problem:
When I run the sub-report by itself, it works to perfection. If the detail
records does not take up the entire page, then "dummy" records are printed
and the Totals line is printed at the bottom of the page. However when the
main report ( which calls the sub-report ) is run, only 4 "dummy" records
were printed and they never filled up all the empty spaces. Also, the
Totals line ( i.e. MemberID Footer #2 ) was never triggered.
Can someone please tell my how I can correct this problem or how I can do
this properly?
Thanks in advance
Andrew