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

Determine if record is last one on a page

Status
Not open for further replies.

vb6novice

Programmer
Sep 23, 2002
288
US
How can I determine if a record is the last one that will be printed on a page (in a multipgae report).

I want to have a line under each record but have it suppressed for all but the last record on each page.

 
Why not just place a line in a page footer section?

Otherwise, you could use a formula to establish the number of lines per page like:

//{@linecnt}:
whileprintingrecords;
numbervar linecnt := linecnt + 1;

You would place this in each of the visible group and detail sections. This presumes that each section is the same height so that the count is the same on each page.

You can reset it with the following placed in the page header:
whileprintingrecords;
numbervar linecnt := 0;

Then you could use a suppression formula of:

{@linecnt} <> 50//or whatever the page line count is

-LB
 
lbass,

Thanks for the tip.

The records are of equal height.

I tried to place a line in the page footer section but it won't match up with the bottom edge of the vertical lines that are at the sides of each record (it's supposed to look like a border around the whole group of records, but there is a gap between the last record's vertical lines and the page footer horizontal line).

Your other option sounds better, however, you said:

You can reset it with the following placed in the page header:
whileprintingrecords;
numbervar linecnt := 0;

Then you could use a suppression formula of:

{@linecnt} <> 50//or whatever the page line count is

Where in the page header do I place the whileprintingrecords formula (please be specific. There's so many places in CR to put formulas I'm having trouble determining where each formula to do what is supposed to be)?

 
Create {@reset} in the formula editor (field explorer->formula->new) and then drag it into the page header. {@linecnt} should be placed in the visible group sections and the detail section. You could then use the bottom line of a text box in each of the detail section, group header and group footer sections (because you won't know which one will be line #50 (or whatever your count is). Then instead of suppression, you could use the x+2 for the bottom line for the formula:

if {@linecnt} = 50 then crSingleLine else crNoLine

-LB
 
Hi there

lbass suggestion is a good one and should work, but if you make sure the details section is the same height as the fields it contains, then placing a line at the top of the page footer section will match up the vertical field borders.

HTH

Gary Parker
MIS Data Analyst
Manchester, England
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top