Thursday, March 27, 2014

Crystal Reports : Using a custom selection within 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:

devil jiang said...

Haven just doesn't fendi outlet do a good job of explaining things. At the end of the episode I'm left with this "Huh?" feeling. I got the episode where prada handbags the kid could manifest his dreams, that wasn't too original anyway. But why should getting upset cause the food the resturant owner just ate to spoil replica chanel and how did this woman change appearance and replica rolex gestate a baby in a week? It's all garbled nonsense.