Tuesday, December 28, 2010

Crystal Reports : Using an (all) selection as a parameter

Let us consider our {?UserID} parameter, which accepts multiple values.
Let us further consider that the end-user will need to occasionally print the report for all UserID's. They could simply add each UserID to the parameter before printing the report, but in cases of many UserID's, this becomes cumbersome.
A better solution is to give an "all" option in the parameter choices, then use the following code:

if {?UserID} not like "*all*" then {SALES.USERID} = {?UserID} else true

Here is what's happening:
IF our parameter DOES NOT have he word "all" within it, we execute the Selection Criteria normally. The trick here is that our ELSE clause ends in TRUE, which means that we "skip over" this part of the Selection Criteria, therefore returning ALL UserID's.

1 comment:

marko said...

Second, recollect that it's substantially simpler to get conned online than disconnected. So be cautious when you make any exchanges in the Internet, particularly if a ton of cash or something as valuable as your house is in question. Check Cashing