crystal-reports-xi

Crystal Reports cross-tab suppress row formula


I have a cross-tab that is presenting information as follows:

+----------+-------+
| UserName | Total |
+----------+-------+
| User1    | $5    |
| User2    | $10   |
| User3    | $50   |
| User4    | $15   |
| User5    | $20   |
| User6    | $0    |
+----------+-------+

I cannot figure out how to suppress rows based on a formula. I want to limit records to User1, User2, and User3 - I have tried the following suppression formula:

IF {Command.UserName} IN ['User1', 'User2', 'User3'] THEN FALSE

Unfortunately this has not worked. I am at a loss here.


Solution

  • If you have tried to use the suppression formula in Format Field options menu you will probably will not achieve the desired goal because it does not work as a filter in your rows. You should apply your filter on the UserName field before you use it in your cross-tab. You can use the Record Selection Formula for this and put your condition in there e.g.

    IF {Command.UserName} IN ['User1', 'User2', 'User3']
    

    (I am not sure if IN operator will work exactly as you want it but in any case you can figure out your condition)