Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Dynamic Sort Post Reply Post New Topic
Author Message
ScubaVal
Newbie
Newbie
Avatar

Joined: 09 Mar 2007
Location: United States
Online Status: Offline
Posts: 12
Quote ScubaVal Replybullet Topic: Dynamic Sort
    Posted: 18 Sep 2007 at 8:50am
Hello, everyone.  I want to dynamically change the sort order of my report based on a parameter.  How do I do this?
try it... if it doesn't work, google it
IP IP Logged
ScubaVal
Newbie
Newbie
Avatar

Joined: 09 Mar 2007
Location: United States
Online Status: Offline
Posts: 12
Quote ScubaVal Replybullet Posted: 18 Sep 2007 at 11:06am
I found my answer on another board, but I have more questions. 
 
For reference sake, I didn't know I could use a formula for the sort order, so once I created the formula it worked as desired, except for ascending/descending. 
 
In the formula I had to change the date field totext, and then it worked (the other sort order fields are text fields).  Why is this?  And does it affect the ascending order?
 
In the report, when I select the date field as my sort order, the dates are descending, not ascending.
 
How I make sure the order is ascending?  I set it on the formula in the Sort Expert, but it isn't working on the date (ie, 10/17/07 appears before 09/14/07).
 
Thanks.
try it... if it doesn't work, google it
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 18 Sep 2007 at 12:37pm
I didn't realize that you had to set the date to text. I need to test this to see what is going on. But assuming this is the case, format the date so that the text version will sort properly as well: YYYYMMDD. Also, on the Record Sort Expert dialog box you can specify Ascending or Descending.
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
IP IP Logged
ScubaVal
Newbie
Newbie
Avatar

Joined: 09 Mar 2007
Location: United States
Online Status: Offline
Posts: 12
Quote ScubaVal Replybullet Posted: 18 Sep 2007 at 1:32pm
Brian,
I have the formula name in the Sort Expert set to ascending.  Here is my formula:
//sort by selection
Select {?SortBy}
Case "Builder":
{ABM_MASTER__CONTACT.Contact_name}
Case "Project":
{PJM_MASTER__JOB.Description}
Case "Bid Date":
totext({PJM_MASTER__JOB_CUSTOM_FIELDS.Bid_Date})
 
Does this change the filed type in the report to text?  Or is there more I need to do in this formula, i.e., the YYYYMMDD you mentioned?  Or would that be done on the field in the report?
 
Thanks!
try it... if it doesn't work, google it
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.016 seconds.