Tips and Tricks
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Tips and Tricks
Message Icon Topic: Top N (1) In Sub Report? Post Reply Post New Topic
Author Message
jamesklett
Newbie
Newbie


Joined: 18 Feb 2011
Online Status: Offline
Posts: 2
Quote jamesklett Replybullet Topic: Top N (1) In Sub Report?
    Posted: 18 Feb 2011 at 7:49am
I cannot get the Top N feature to work in my Sub Report. 
 
Suppose I have a master rfeport showing Employees, and I have a Sub-Report that show all their related Timecards.  But, I only want to show their most recent n timecards.  n can be 1 for this example.  When I add the group, and the summary in the sub report and then use the Group Select top n feature, the report still pulls all timecards, not just the top n.  I am guessing that this is because of the Sub-report Links from the master report override the top n, but then how can I do what I need to do here?
 
Thanks,
 
JIM
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 21 Feb 2011 at 8:02am
If you want to show just the most recent timecard you can do the following:
 
1.  Group on Employee ID - there should be only one value for this in the subreport, but it helps us get the format we need.
 
2.  Order descending on the date of the Time Card.
 
3.  Put all of the data in the group header - this will show only the most recent time card.
 
If you need to be able to show more than 1, it gets a bit more complicated, but it can be done.
 
-Dell
IP IP Logged
Post Reply Post New Topic
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



This page was generated in 0.031 seconds.