William
William

Reputation: 508

Selectively showing groups in Crystal Reports

I have a report which displays information by group; I'd like to not show any group that doesn't have at least two items in it. Is there an easy way to do this?

Example:

Bob
   3/1
   4/3

Joe
   3/2
   3/7
   3/9

Mark
  5/9

James

John
  8/17
  9/2

Grouped on name, should not show Mark or James.

Upvotes: 0

Views: 2138

Answers (2)

craig
craig

Reputation: 26262

You could create a group-selection formula (Report | Selection Formula | Group...):

Count({table.field_to_count}, {table.grouped_field}) < 2

Upvotes: 0

Ryan
Ryan

Reputation: 7287

If your report is simplistic enough, you can get away with just suppressing the Group Header, Group Footer, and Details sections by using a summary function like count({table.somedate},{table.dudesname}) < 2. Note that the second parameter to a summary function has to be a field being used to group on.

Your mileage may vary with doing it this way. If you are displaying calculated summaries in the report footer, for example, it won't make sense to just suppress these groups as their data will still affect any report-level summary. The other problem you might run into is needing to use a distinct count on some field instead of just a count, depending on your table joins.

Upvotes: 1

Related Questions