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!

How do I get a location name from a parameter?

Status
Not open for further replies.

ftwiudan

Programmer
Jan 20, 2012
4
0
0
US
I have a report that I want to print location names from a location table using a location parameter. The location parameter can have multiple values. I have a loop to print out the location numbers, but I want to print the location name.
 
try this,
Join({?SelectedLocationNames},", ")
Betty
 
If the parameter is based on the location number, then you either have to hardcode the locations in a formula like this:

numbervar i;
numbervar j := ubound({?Location}):
stringvar x :=
for i := 1 to j do (
x := x + (
select {?Location}
case 123 : "London"
case 234 : "Paris"
case 353 : "Moscow"
) + ", ";
left(x,len(x)-2)

Or, if there are too many to hard code, add a subreport, create the same location parameter as in the main report, link the sub to the main report by linking the parameters to each other, and then add the location field to the detail section. You can collect the values in a variable if you want a paragraph style display versus a list display.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top