Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Report Header Information Post Reply Post New Topic
Author Message
Haplo
Newbie
Newbie


Joined: 20 Mar 2008
Online Status: Offline
Posts: 1
Quote Haplo Replybullet Topic: Report Header Information
     Posted: 20 Mar 2008 at 3:44am
I have some data i want to display in the header of my report.
 
here is a short example.
 
ID........DOB.........Name.....Surname
 
1........01/01/1965....Tom.....Jones
2........02/02/1963....Fred....Bloggs.
3........17/05/1978....Gin......Rummy.
 
 
Now, you can find out who is the oldest person by setting a variable to
 
Minimum(DOB)
 
Ok, so how can i get, into a variable, the Name associated with that Minimum DOB??
 
 
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 20 Mar 2008 at 2:22pm
This is a tough one.  As much as I try to avoid subreports, you're probably going to have to use one - especially since the data for the main part of your report is probably sorted and grouped, but not in DOB order.
 
Here's what I would do:
1.  Create a small subreport to put in the header.  Use the same table as your main report.  Link to the parameters (if any) on your main report so that you have the same selection criteria for both.
2.  Sort the subreport data on DOB, Ascending.
3.  Suppress ALL sections of the report except one Report Header.  In that header put the Name and DOB fields.
 
This will only display the first record, which should be the oldest person because the data is sorted by DOB.
 
-Dell
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