Print Page | Close Window

Group by One Field Sort by Another

Printed From: Crystal Reports Book
Category: Crystal Reports for Visual Studio 2005 and Newer
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
Printed Date: 29 Jun 2022 at 3:50am

Topic: Group by One Field Sort by Another
Posted By: BernieHunt
Subject: Group by One Field Sort by Another
Date Posted: 04 Nov 2008 at 3:37pm
I have a report of patient statements. Each patient's data is tracked by their PatientID. Crystal Groups on the PatientID field. At the end of each ID is a new page.
I'd like to sort the statements by a different field. For example the Last Name. When I look into the Record Sort Expert, it won't let me put the Last Name field as a higher sorting priority than the PatientID.
How do I sort by a field other than my Group Sort?
Also, is there a way to keep Crystal from sorting and let me sort the dataset before giving it to Crystal?

Posted By: jonberardi
Date Posted: 06 Nov 2008 at 10:08am

I have the exact same question.  I am grouping records by UserID and need it sorted by Last Name. 

Any help is greatly appreciated!

- Jon

Posted By: BernieHunt
Date Posted: 09 Nov 2008 at 7:03pm
I didn't find a way in Crystal, but I found what I think is a better way for me. If you open the Group Expert and in the right pane select the group you are sorting by. Click the options button to see the Change Group Options dialog. The second drop down box is the order selection. Change that to "in original order".
This returns control of the sort order to your code. You can sort your data any way you want in the dataset and then hand it to Crystal. Crystal will group by the field you selected, but the sorting is what you gave it.
This what I've found works for me, but I haven't heard from anyone else on the subject.

Posted By: Pradeep1210
Date Posted: 30 Jun 2011 at 4:14am
Please have a look here for a possible solution: -


Posted By: shortwrite
Date Posted: 14 Sep 2011 at 6:07am
BRILLIANT!!  I read your solution, and it worked for me...  I am relatively new, and have had no training...  (OTJ only)
THANKS!  Smile

Posted By: jorrebor
Date Posted: 23 Nov 2011 at 4:39am
How about interactive sorting?

Once i present crystal with an ordered list, the interactive sort control (on the other field) destroys the original order.

I would like to add 2 interactive sort controls without grouping. Any ideas on this?


Print Page | Close Window