Visual Studio 2008 and Crystal Sort Option

I have an application with a report in it, that when runs shows the report.   Similar to when you add parameters and a user is prompted when they run the report to enter the parameter is there any way to prompt the user when they run the report to allow them to select a sort option.  (I have two fields and I want them to be allowed to sort by either).  If not prompted, is there anyway for them to sort in the actual report when it is showing?
jwebster77Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Éric MoreauSenior .Net ConsultantCommented:
I have that kind of reports with customizable sort options.

I ask the question before retrieving the values so it gives me time to alter my query to retrieve adding the proper "order by" clause to my query.

Check http://emoreau.com/Entries/Articles/2006/09/Feeding-Crystal-Reports-from-your-application.aspx to see how I am pushing my data to the report.
0
mlmccCommented:
It can also be done with parameters as you suggest.

There are 2 ways to do it.

If the fields are the same type add a formula and change the sorting to use it.

If {?SortParam} = 'A' then
     {Field1}
Else
     {Field2}

If the fields are different types then use 2 sort fields and formulas
Assume Field1 is text and field2 is a number
Sort1
If {?SortParam} = 'A' then
     {Field1}
Else
     "A"

Sort2
If {?SortParam} = 'A' then
     0
Else
    {Field2}

mlmcc
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Crystal Reports

From novice to tech pro — start learning today.