Monday, April 2, 2012

Crystal Reports : Parameters with Multiple Values

One of the nicest things about Crystal is it's ability to accept multiple values into one Parameter. However, easily displaying the list of values on the report is another story;

You will notice that when a Parameter has "Allow Multiple Values" enabled, you can't just drag it onto the report. We must first run it through the Crystal JOIN() function.

Assuming our Parameter is called {?UserID}, our formula will look like this:

JOIN({?UserID}, ", ")

This will return all values within the {?UserID} parameter, separated by commas. Notice that the second parameter of the JOIN() function defines the list delimiter. In this case, a comma and then a space. Try it! Having the parameters the end user selected on the report can be invaluable.