Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Sorting within group sections Post Reply Post New Topic
Author Message
bam1980
Newbie
Newbie


Joined: 11 Mar 2012
Online Status: Offline
Posts: 2
Quote bam1980 Replybullet Topic: Sorting within group sections
     Posted: 11 Mar 2012 at 10:28am
I have a report which groups by "proposal status." So: "in development," "submitted," "accepted," "rejected," etc...

What I need to do is keep the grouping by proposal status but sort differently within each section depending on what the status is. For example, for the "accepted" section I want to sort by "date accepted" but for the "development" section I want to sort by "client name." Is there any way to do this? I thought of using a formula to sort by but since "date accepted" is a date field and "client name" is a string, it doesn't seem to work.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 12 Mar 2012 at 4:34am
one way would be to use 2 formuals. 1 for dates and one for text. Add each to your sort expert (ascending or descending depending on your need)
By doing this each formula will still sort but since all values are the same for the else then it will only use the one formula to visuualy sort
//datesort
if table.status = 'accepted' then table.dateaccepted
//textsort
if table.status = 'developement' then table.clientname  else if table.status = 'rejected' then able.other_value
IP IP Logged
bam1980
Newbie
Newbie


Joined: 11 Mar 2012
Online Status: Offline
Posts: 2
Quote bam1980 Replybullet Posted: 12 Mar 2012 at 7:21am
Worked like a charm! Much thanks DBlank.
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum