Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Giving the user the ability to sort

Status
Not open for further replies.

f0rg3tfu1

MIS
Aug 25, 2004
103
US
Hey All,

CR 10, SQL 2000

I am posting all of my reports to Crystal Enterprise. I want to give the user the ability to sort by different columns.

Any ideas on how to do this with a formula?

I was thinking just give them a selection of like 1,2,3,4,5. If (selection formula) = 1, then sort by column A. If (selection formula) = 2, then sort by column b.

Thanks for the help!!!
 
That would depend on the data types required for sortation.

Create a parameter which has the choices of the fields that they might sort by.

Now you can either create a group from the formula or just select the formula as your sort field.

ex:

if {?MySortParm} = "State" then
{table.state}
else
if {?MySortParm} = "City" then
{table.city}
etc...

Thre only trick is if you have multiple data types in one formula, Crystal doesn't support this, so convert them to text.

WIth numerics the order won't work unless you pad them with zeros.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top