Report Design
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Report Design
Message Icon Topic: Sort based on specific field Post Reply Post New Topic
Author Message
bplvid
Newbie
Newbie


Joined: 11 May 2015
Location: Canada
Online Status: Offline
Posts: 3
Quote bplvid Replybullet Topic: Sort based on specific field
    Posted: 28 May 2015 at 5:00pm
I have a report which I need to Group by type but the rows under the group should be sorted based on specific field code. from the below eg. the code field needs to be sorted in NSL,CON,RWR,TAN order within the grouping.

TYPE        DATE   NAME      CODE

Cem                   
cem                                  NSL
cem                                  CON
cem                                  RWR

Fun
Fun                                   NSL
Fun                                   CON
Fun                                   RWR
Fun                                   TAN

Class
Class                                 NSL
Class                                 RWR





IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 29 May 2015 at 6:33am
Create a formula that looks something like this:

Switch(
{MyTable.Code} = 'NSL', 1,
{MyTable.Code} = 'CON', 2,
{MyTable.Code} = 'RWR', 3,
{MyTable.Code} = 'TAN', 4
true, 5
)

Go to the Sort Expert and use this formula as a sort under your group.

-Dell
IP IP Logged
bplvid
Newbie
Newbie


Joined: 11 May 2015
Location: Canada
Online Status: Offline
Posts: 3
Quote bplvid Replybullet Posted: 01 Jun 2015 at 8:34am
That Worked. Thank you.
IP IP Logged
Post Reply Post New Topic
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



This page was generated in 0.020 seconds.