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?
 
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
 
É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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.