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

Determine if bottom of page

Status
Not open for further replies.

Bisquite

MIS
Jul 2, 2003
23
GB
Is there any way of telling if you are at the bottom of the page or not? I am using CR10 into SQL Server 2000.

I have a report with detail information and group footer summaries and would like to prevent the group footer printing on its own at the top of a page when the last record of the group was printed at the bottom of the last page.
I have tried using "Keep Group Together" in the group options, this works to a certain extent but does leave white space and I want to keep the report flowing as much as possible (there are a lot of groups and a lot of data).
Ideally what I want to do is determine whether a detail line is the last in the group (I can do this) and whether it is at the bottom of the page.

Any ideas very welcome.

Andy
 
If your sections are of the same height, you can create two formulas:

//{@reset} to be placed in the page header:
whileprintingrecords;
numbervar linecnt := 0;

//{@linecnt} to be placed in every group header, detail, and group
//footer section:
whileprintingrecords;
numbervar linecnt := linecnt + 1;

This should give you a count of lines per page. You could then use this number along with your formula for whether the detail is the last detail in the group to do a conditional page break.

-LB
 
Thanks for the idea. As you say that would work if my sections were the same height (and so I would know how many lines there are per page), but they aren't.
 
If the header/footer sections are of consistent height and the height is a multiple of the detail height, you can adapt this solution by creating a separate formula for each section. For example, if the group header and footer are twice as high as the detail section, then create a formula:

whileprintingrecords;
numbervar linecnt := linecnt + 2;

Place this formula in the group header and footer and use the other formula (with linecnt + 1) in the detail section. Then test to see if the linecnt is the same on each page. It will be, if the section heights are exact. You can manipulate them more easily if you enlarge the view to 200% or something like that.

This won't work if you have objects that can grow and which will change a section's size.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top