473,385 Members | 1,320 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

report footer location problem

hi all,

i am quite new to access and have come stuck on quite a simple problem (i think). i have created a report which list items from an orders table etc..

as the report could grow (listing lots of items from an order), i want only the last page of the report to display a message, i.e. Regards, and a space for a signature, along with a box for a autorised stamp.

I tried using the report footer and put my message there with signature, etc.. but when the report goes over one page the info i place in the footer is not at the bottom of the last page. sometimes in the middle, sometimes at the top (depending on the size of the order list, pushing the report footer down)

is there a way to make the report footer stick to the bottom of the page? depending on the size of my order the report could be 1 to say 3 pages long.

any suggestions would be a great help. :confused:
Jun 9 '06 #1
6 10579
CaptainD
135 100+
Try putting it in the "Page Footer", not the "Report Footer", should stay at the bottom
Jun 9 '06 #2
Yeah thats right, thanks.

but that still doesnt fix the problem. as it displays the page footer on every page. whereas i jst want to display my message and stamp box on the last page. which could be the 1st page (if a small number of order items) or many pages (with a large order)

does that make sense?
Jun 9 '06 #3
CaptainD
135 100+
Place this in the "PageHeaderSection_Format" (assuming you have 5 sections ReportHeader, PageHeader, Details, PageFooter, ReportFooter)

Me.Section(4).Visible = (Me.Page = Me.Pages)
Jun 9 '06 #4
thanks for that. it worked if the report went over 1 page long. displaying the footer only on the last page.

but was causing a problem when the report was only one page. i checked the code and it seems right to me. i think there must be a problem / bug with access. with a report of one page in length, the method runs a couple of times with the value of Me.Page and Me.Pages as follows

1st time
Me.Page = 1
Me.Pages = 0

2nd time
Me.Page = 1
Me.Page = 1

so the footer should be visable, after the 2nd run of the method, but it isnt?

i got round the problem with the following if statement

Private Sub PageHeaderSection_Format(Cancel As Integer, FormatCount As Integer)
If (Me.Pages > 0) Then
Me.Section(4).Visible = (Me.Page = Me.Pages)
End If
End Sub

it now works fine, for one page or many pages,

thanks again
Jun 9 '06 #5
Nick67
2
Hi,

I have had this problem over and over again--and now that I have it licked, I want to document it.
<arrg>If your report is very complex me.page = me.pages logic often will fail </arrg>
What does work, I found on www.tech-archive.net, and the poster there said he found it originally on Accessweb. Thanks all.

First, you need a group header and footer that can encompass your entire report--something in the underlying query that is the 'one' in a one-to-many relationship. These headers MUST be visible--or their events don't fire--but the controls in them don't need to be visible and their heights can be set to 0.0007"
In the header, put a textbox named txtFtr, set visible = false and height to 0.0007.

Next, in the group header's PRINT event add
Me.txtFtr = True
in the group footer's PRINT event add
Me.txtFtr = False
and finally in the pagefootersection's FORMAT event add
Cancel = Me.txtFTR

How does it work?
Because you picked a group that brackets the whole report, the group header is printed right after the report header and page header--and this sets txtFtr to true. The page footer's format is then cancelled on that page and every subsequent page until the group footer is printed at the end of the report (because, again of your choice of group) which sets txtFtr to false and allows the page footer to be printed.

This worked for me on a report with seven subreports, most of which have noData = true. As a result [page] of [pages] would lie. I would get [pages] = 3--but only 2 pages rendered. As a result, me.page NEVER equals me.pages and the footer would not show!

Hope this helps those who Google after me!
Nick67
Sep 23 '08 #6
Nick67
2
Hi All,

Do you ever think with an Access report "close enough, quit messing with it"?
I do have my report working the way I want--finally.

The complication was that I wanted to not only stick a bunch of printing at the bottom of the last page of the report, I also wanted pagination, so I wasn't just cancelling a pagefootersection_format event. Because page footers DO NOT have CanGrow/CanShrink properties, that meant I was dynamically messing with the page footer size at format time. That was OK until the report crept down far enough that the newly sized footer should have gone onto a new page. Instead, it overlapped with the print above it. What to do...

I used the 'move group footer' method from kb208979.
I declared variables in the report's module

Option Explicit
Dim FooterMove As Long
Dim GotLowEnough as boolean
________________________________

I created the function:

Private Function SetGrpFtrLoc(GrpFtrLoc As Double)
If Me.Top < GrpFtrLoc Then 'Not at location yet, so
Me.MoveLayout = True 'move to next print location.
Me.NextRecord = False 'Do not go to next record.
Me.PrintSection = False 'Do not print the section.
End If 'Until the required offset is reached

FooterMove = FooterMove + 1
End Function
______________
and altered the groupfooter's format and print events
______________
Private Sub GroupFooter1_Format(Cancel As Integer, FormatCount As Integer)

Dim GrpFtrLoc As Double
GrpFtrLoc = (11 - 0.325 - 0.325 - 0.1667 - 1.125 - 0.25) * 1440
'top of my page footer , paper length minus margins and control heights

'we'll get here when the function call forces a re-format
If gotlowenough = True Then
Me.GroupFooter1.ForceNewPage = 2 'force a new page
End If

If Me.Top > GrpFtrLoc And FooterMove = 0 Then 'we are overprinting already
gotlowenough = True
End If
Call SetGrpFtrLoc(GrpFtrLoc)

End Sub
______________
Private Sub GroupFooter1_Print(Cancel As Integer, PrintCount As Integer)
If Me.GroupFooter5.ForceNewPage = 2 Then
Me.txtFTR = True
Else
Me.txtFTR = False
End If
End Sub
_____________
I was also forced to create another 'overall' grouping of a 'one' in the one-to-many relationship, because you CAN"T force a new page to print just a PageFooter. The new groupfooter is lower than the original, and has a line control in it and again, a height of just 0.0007." Note that if this footer is not visible, or has no control in it, no events will fire for it. Jus in case you try this and think to completely hide that unneeded stuff :) It also has this code:

Private Sub GroupFooter2_Print(Cancel As Integer, PrintCount As Integer)
Me.txtFTR = False
End Sub

Page of Pages was again occasionally incorrect, so I settled for just Page. The end result is a report that has a page number on every page, and has 1.125" high subreport with some required stuff stuck to the bottom of the last page, and that doesn't mangle itself if the sections above come down into the area needed by that longer page footer.

Nick67
Sep 25 '08 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Galina | last post by:
Hello I have a report, which lists records. Each record has money paid field. Money paid can be 0 or not 0. I calculate and print summary of money for a group in the group footer, as well as...
3
by: ahaque38 | last post by:
Hello. Using A2K SP3, I am having the following problem with a report using "Sorting and Grouping". I have recently added a grouping in the reports for "Category2<>'CONTRACTS'". I have...
4
by: Trevor Best | last post by:
I have a report that's fairly simple, page headers and footers, detail has a subreport in (can vary in length). The customer wanted a signature block for them, their client and 3rd party. This was...
13
by: Greg | last post by:
Most suggestions on this topic recommend to use a page footer and make it visible only on the last page. My problem is that the footer is half of the height of a page which means the detail would...
4
by: lupo666 | last post by:
Hi everybody, this time I have three problems driving me nuts :-((( (1) I have a report with 20 or so Yes/No "squares". Is there a way to either hide/show the "square" or change the yes/no...
2
by: Simon | last post by:
Dear reader, In case a report is a sub report the Report Header of the sub report is printed in the report but the Page Header of the sub report will not be printed. This is the same for...
12
D Giles
by: D Giles | last post by:
Access 2003: A subreport control (sum total calculated textbox located in the subreport report footer) does not show total of all records when referenced as a total in the main report footer - only...
0
by: Josetta | last post by:
Here is something really bizarre that is happening...let me see if I can describe it. I have a report which has two locations on it. Primary Location and Secondary Location. I have both...
7
by: Evanescent | last post by:
Hi guys, as the title suggests, I'm facing some problems with the report. I have a form (createInvoiceForm) whereby the user can enter the invoice's details and then click on the Add New Record...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.