Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Page headers on pages with no data

Status
Not open for further replies.

ammiller

Programmer
Nov 21, 2002
8
IE
I have a report which has the column titles in the page header.

I also have a report footer which takes up approx 1/2 page.

If the data on the last page is more that 1/2 a page long, the next page will (quite rightly) contain the report footer.

Except that the last page will also include the page header - which is column titles with no data underneath it.

I also have a report footer which has company logos and report title. But i want these logos (and report title) to appear on each page.

So my problem is

1. How do I have my logos and report title appearing at the top of each page?
2. How do I prevent the column labels from appearing on the last page if there is no data underneath it (i.e. only the report footer is there).

To get around this, the user is happy to have just the logos on the first page, and the footer to appear always on it's own page at the end of the report. This is done by changing the properties of the report where the page header is set to "Not with Rpt Ftr" - but I want to be more flexible than this.

Can anyone help?

Thanks
 
If you want information to be displayed at the top of each page, you must put it in the PageHeader, along with anything else that's already there. Same for the bottom of the page, it must be in the PageFooter.

To prevent the column headers from showing on the last page, you must find a condition that indicates the end of the data. Usually you can do this by saving one of the field values from the records and comparing it with the same field on the current record. This field must have a different value from one record to the next, or this won't work.

Dim mblnEndofData as boolean
Dim previousvalue as <datatype of field you're checking>

IF me.fieldvaluetocheck = previousvalue then
mblnEndofData = true
else
' save current value
previousvalue = me.fieldvaluetocheck
end if

You normally need to put the code above in the Detail section, since you need to do this before you print the next pageheader. In the pageheader section you can test
for mblnEndofData and then make those column headers not visible.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top