Print Page | Close Window

Display name vs number in header

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2022
Forum Name: Tips and Tricks
Forum Discription: Have you learned some great tricks to share with the group? Post them here!
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=15821
Printed Date: 03 May 2025 at 10:48pm


Topic: Display name vs number in header
Posted By: sneveu
Subject: Display name vs number in header
Date Posted: 07 Mar 2012 at 7:30am
I am creating a report where the user has 2 parameters to enter a range for Sales Rep.    1002 to 4500.  
I print the user selection in the header as
Sales Rep 1002 - 4500.  
 
A request has been made to instead of showing the sales rep number to instead display the name.  So they would want to see:
Sales Rep:  John Smith - Mike Johnston, where 1002 = John Smith and 4500 = Mike Johnson when selecting 1002 - 4500.
 
How can I display the names in the header?  The name does not exist in the one table I am using so I don't know how to use the parameter to link to the sales rep table to get the name.
 
Is this possible?
 
Thanks



Replies:
Posted By: lockwelle
Date Posted: 23 Mar 2012 at 3:48am
you could use a subreport for each name...the subreport can link to the other table as needed.


Posted By: comatt1
Date Posted: 31 Aug 2012 at 6:03am
make a sql expression

(select top 1 name from nametable a inner join
idtable b on
b.id = a.id)



Print Page | Close Window