Solved

Crystal Reports - User Input for Sort

Posted on 2013-05-21
6
227 Views
Last Modified: 2013-05-28
Hi there,

I have a request to create two sorts;

One is either ascending or descending by last name and the other is to choose either ascending or descending by amounts called ratings.

When the user runs the report, he/she would like to be asked to choose on of the options, ascending or descending for each.  I have played around with this and have reviewed some other cases but none seem to touch upon this.  

Any advice? Thank you in advance,
CS
0
Comment
Question by:rporter45
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 101

Expert Comment

by:mlmcc
ID: 39185172
Is that to sort on a single field?

Are the fields the same datatype? ie both are text/string?

mlmcc
0
 

Author Comment

by:rporter45
ID: 39185246
Hi there,

There are two fields - the first is a field called sort name - this is a string.

The second option they would like is to sort by rating that is currency.

They would like one or the other but not both at one time.

Thank you -
CS
0
 
LVL 101

Accepted Solution

by:
mlmcc earned 350 total points
ID: 39185342
2 parmaeters and 4 formulas

Parameters
SortFIeld - allow use r to choose the field
SortOrder - Allow user to specify sort direction

Formulas
Name - Sort1
If {?SortOrder" = "A" and {?SortField} = "Rating" then
    {RatingField}
Else
    0

Name Sort2
If {?SortOrder" = "D" and {?SortField} = "Rating" then
    {RatingField}
Else
    0

Name Sort3
If {?SortOrder" = "A" and {?SortField} = "Name" then
    {NameField}
Else
    "A"

Name Sort2
If {?SortOrder" = "D" and {?SortField} = "Name" then
    {RatingField}
Else
    "A"

Add the sort formulas to the report sorting
Set SORTs 2 and 4 to DESCENDING

mlmcc
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 

Author Comment

by:rporter45
ID: 39185487
Thanks! I will try these out and get back to you,

take care,
CS
0
 
LVL 23

Expert Comment

by:Ido Millet
ID: 39188263
If you are using a recent version of Crystal, it provides an option to attach sort controls to column headers.  See Crystal online help topic of "Sort controls".
0
 

Author Closing Comment

by:rporter45
ID: 39202325
Worked perfectly!
Thank you -
CS
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question