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

CR10 - Allow multiple values with Discrete and Range Values 1

Status
Not open for further replies.

WaukMyWay

Programmer
Apr 20, 2007
29
US
I am using Crystal Reports 10.
I have a parameter defined as: Allow multiple values and discrete and range values.
When it comes to the record selection for such a parameter, how should it be defined - equal to or some other test?
Also, how do you print the various values the user has selected?

Say this is for a customer database. There are 500 records, each a unique customer number.

This same parameter may be used for just one customer, multiple customers, a range of customers, or any combination of these.

How should the record selection be tested? {CustomerNumber.Customer} _______ {?CustomerNumberRange}

How do you show what the user selected on the report?
 
You can use a record selection formula like this:

{CustomerNumber.Customer} = {?CustomerNumberRange}

To display the selections use:

whileprintingrecords;
stringvar x;
numbervar i;

for i := 1 to ubound({?CustomerNumberRange}) do(
if minimum({?CustomerNumberRange})= maximum({?CustomerNumberRange}) then
x := x & minimum({?CustomerNumberRange})&chr(13)
else
x := x & minimum({?CustomerNumberRange})& " to "& maximum({?CustomerNumberRange})&chr(13)
);
left(x,len(x)-1)

Format the formula to "can grow".

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top