Supress page footer on all but last page.

D

Dennis

Hi,

I want to suppress the page footer on all pages of the report except the
last page.

In the report's On Open event, I run the following code:

pintPgFootHeight = Me.PageFooterSection.Height ' Save height for later
Me.PageFooterSection.Height = 0
Me.PageFooterSection.Visible = False

In the reports On Page Footer Section Format event, I have the following code:

If [Page] = ([Pages]) Then
Me.PageFooterSection.Height = pintPgFootHeight
Me.PageFooterSection.Visible = True
End If

The page footer prints on every page with this code.


I also tried the follow code in the On PageFooterSection Print event:

If [Page] = ([Pages] ) Then
Me.PageFooterSection.Height = pintPgFootHeight
Me.PageFooterSection.Visible = True
End If

And in this case, no footers are printed on any page.


Any suggestions?
 
D

Dennis

Daryl,

The report footer prints after the last line of the detail report. So if
the last line is in the middle of the page, the report footer prints in the
middle of the page.

That is the way I originally coded the report, but I need the total to
appear at the bottom of the report, not in the middle of the page.

I did ask how to force the report foot to appear at the bottom of the page
and I received this response from Marshall Barton:


Not easily, but it can be done. Add a top level group (View
- Sorting And Grouping) with footer using a constant
expression such as =1 Don't add anything to this group
footer.

Use code in this group footer's Format event to adjust its
height to fill the page down to where you want the report
footer to be. The code to postion the report footer 9
incehs from the top of the page would be something like:

Const FOOTERPOSITION As Long = 9 * TPI ' 9 inches

Private Sub GroupFooter0_Format(Cancel As Integer,
FormatCount As Integer)
If Me.Top < FOOTERPOSITION Then
Me.Section(6).Height = FOOTERPOSITION - Me.Top
End If
End Sub

I have not experimented with scenarios when there is not
enough room for the report footer on the same page as the
last detail.

----------------------------------

Someone else suggested using the page footer. It appeared that the page
footers where a simpler solution than the above. It would be a simpler
solution if I could figure out how to suppress the the page footers.

One piece of information I may have left out. The report works great in
print preview. The footers do not appear on the first page. However, when I
print, the footers appear on all pages.
 

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