Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Crystal Reports - Select distinct records in group

I'm trying to figure out how to show distinct records in groups in crystal reports. The view I wrote returns something like this:

Field 1  |  Field 2  |   Field 3
----------------------------------
    10   |   111     |  Record Info 1
    10   |   111     |  Record Info 1
    10   |   222     |  Record Info 2
    20   |   111     |  Record Info 1
    20   |   222     |  Record Info 2

The report groups are based off field one, and I want distinct fields 2 and 3 for each group:

Field 1  |  Field 2  |   Field 3
----------------------------------
    10   |   111     |  Record Info 1
    10   |   222     |  Record Info 2
    20   |   111     |  Record Info 1
    20   |   222     |  Record Info 2

Field 2 and 3 are always the same, Field 1 acts as an FK reference to any entries in the view. Selecting distinct xxx in the view isn't really viable due to the huge amount of columns being brought in.

Can this be done in CR?

Cheers

like image 865
Jamie S Avatar asked Dec 25 '22 13:12

Jamie S


2 Answers

  1. Create a group for field1, field2
  2. Hide Details area, field1 group area header and field1 group footer
  3. Drop all the columns you want to show in the field2 group area header/footer.

Good luck!

like image 161
Jade Avatar answered Jan 10 '23 13:01

Jade


You might also consider using Database | Select Distinct Records.

like image 44
craig Avatar answered Jan 10 '23 15:01

craig