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

parameter help!!!!

Status
Not open for further replies.

lyu

Programmer
Feb 8, 2005
26
0
0
US
I have a stored procedure which takes a parameter studentID(number). However, my users have a hard time memorizing all studnetIDs, instead, they'd like to input studentName as parameters. Assume the studnetID and studentName relationship is stored in a table studentInfo, is it possible that a user inputs studentName, and crystal report looks up the corresponding studnetID from the table and then feeds studentID to my stored procedure? Or are there any other ways which can achieve the same thing?

I don't want to change my stored procedure to accept a studnetName parameter since this stored procedure is used in many other places, and I don't want to disrupt all others...

Thanks a lot!!!
 
You can prepopulate the values with a static list in CR 10 and below, CR XI allows for dynamic parameters, so please remember to at least post your software version.

One method you might like is to select the default values button on the create parameter and then you can either read in a text file of the IDs and names, or read directly from a table and then select that the Description (names) be displayed, but the ID is the parameter.

Names can be problematic of course because of duplication.

-k
 
Sorry, I am using CR 10.

Can you explain more of the default value method? I can load all StundetIDs from the studentInfo table and add them as the default values of parameter StudentID, but how can I load the descriptions? All my description for these defualt values are empty, and of course I cannot set them one by one.

Thanks again.
 
You can create a separate report of IDs and names with no column labels, export it to a text file, use find/replace to remove the "", and then in the set default section of the parameter expert, import the text file.

-LB
 
Thanks, that helps a lot!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top