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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Page Header and After Group Of problem

Status
Not open for further replies.

jpgr1964

Programmer
Mar 4, 2004
2
US
I have a report that prints employee timesheet hours. The report is sorted by location (ORDER BY location). The location is passed to the report section as part of a record. I have an "After Group Of location" which prints total hours for that location and then Skips to Top of Page. When the next page prints the Page Header (where the location is printed) it still shows the location just completed.

Shouldn't the new page show the next location? It seems like if I'm sorting on location that each new page should show the new location. Am I doing something wrong? Can I put the Skip to Top of Page in another section?

Thanks.
 
Hi,

>Shouldn't the new page show the next location?

Yes. If you require it.

>It seems like if I'm sorting on location that each new page should show the new location.

Not necessarily. You may have used sql ORDER BY clause and AFTER GROUP of section. It's not enough.

>Am I doing something wrong?

Probably, yes. In the after group section of report you are informing the report to skip to top of page, which in turn calls the header. Though the group has changed the header is not aware, just because, we are still in the after group clause. The group is still the old one not the new one, as one may think.

The easiest way to to solve this kludge is to putup a "before group of" section and tell the report function to skip the page collaterally. That is:

before group of location
skip to top of page

Only add these 2 lines. Rest of the source will remain as it is.

>Can I put the Skip to Top of Page in another section?

You may not be interested in this now. Anyway, The report cannot skip to the top of page while in a header or trailer.

Regards,
Shriyan
 
Thanks for the response! I added the 2 lines and at first there was no change. I then removed the 'Skip To Top of Page' statement from the 'After Group of location' section and it all worked fine. Since the After Group Of is processed first, the page header (with the old location) was printed before the Before Group Of took over.

Thanks for pointing me in the right direction.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top