How to sort group by different field in Crystal Reports

I have a Crystal Report that groups by an identifier field but I want it to sort by a different field. There is always a one to one relationship between the identifier field and the sort order field.
Morgs77Asked:
Who is Participating?
 
James0628Connect With a Mentor Commented:
If it really is one to one, then I agree, it seems like you could just group by the other field.  But if you can't, or don't want to, do that for some reason ...

 What version of CR are you using?  I think some of them may have an option in the group options to change the sort order.  I'm using CR 10 and it does not have that option, but I think later versions may.

 Otherwise, the usual way to handle this would be to group by the other field first, and then your current field.  You can suppress the extra group header and footer if you like.  I suppose a potential down side to this is that the values for the sorting group will be shown in the group tree.  I don't know of any way to get around that.

 James
0
 
Brian CroweConnect With a Mentor Database AdministratorCommented:
Why can't you just group by the "different" field?
0
 
mlmccCommented:
WHile it makes sense to group by the other field you can try this idea

Put the field on the report in the detail section
Right click the field
Click INSERT ==> SUMMARY
Set the summary to be MAXIMUM
Set it to insert in the group footer
Click OK

Click REPORT  -->  GROUP SORT OPTIONS
Set for ALL RECORDS
Choose the Summary field

mlmcc
1
 
Morgs77Author Commented:
Thanks for the help. It was all complicated by hierarchical grouping which didn't work properly when grouping by the 'other field' first. I managed to get around this with a few adjustments to the SQL View.

Works great now. Thanks.
0
 
James0628Commented:
Ah.  I've never used hierarchical grouping, so I'm not sure how that would affect things.  I'm glad you were able to figure it out, and glad I could help.

 James
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.