Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: How do you spot the last record on a page Post Reply Post New Topic
Author Message
Matt
Newbie
Newbie
Avatar

Joined: 04 Jun 2008
Location: United Kingdom
Online Status: Offline
Posts: 19
Quote Matt Replybullet Topic: How do you spot the last record on a page
     Posted: 07 Jan 2013 at 11:48pm

Here's a new year brain teaser for you!

I need react to the last record on the page.  On each last record of the page I want to print 'PTO' but i don't want it in the page footer, I want it on the detail line. 
I'm thinking along the lines of conditionally supressing/showing the text but how can I tell if it's the last record on the page???
 
Any help greatly appreciated.
 
M.
With all due respect.
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 08 Jan 2013 at 9:22am
alas, since it is a classic brain teaser, it is much easier to answer, though no one likes the answer...
 
you can't.
 
you can count lines, but if a field is set to 'Can Grow' and it does, you have absolutely no idea that this has occurred.
 
all the other schemes are permutations on this idea, but since you don't if a line has grown you're out of luck.
 
the other permutation that I have tried is to assign heights each section and add them up. When they reach some value, you tell the report to move onto the next page...but I can see 'Keep Together' getting in the way as well since I don't think that CR tells you when it is going to skip the rest of the page...
 
Barring keep together and can grow, you can usually make a reasonable guess of where you are on the page and react as desired.
 
HTH
IP IP Logged
Matt
Newbie
Newbie
Avatar

Joined: 04 Jun 2008
Location: United Kingdom
Online Status: Offline
Posts: 19
Quote Matt Replybullet Posted: 09 Jan 2013 at 12:08am

Thanks for getting back.

As luck would have it I do have an expanding sub report on the detail line so estimating a number of rows per page is out of the question.
I've mucked about with making a line counter but you can't 'max' it and you can't do a 'next value' test either. 
 
All in all I think I'm snookered.
 
Never mind, a new challenge will be along shortly.
 
M.
 
With all due respect.
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum