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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parameter to Sort group Ascending or Descending

Status
Not open for further replies.

dreman

Programmer
Jan 16, 2002
272
US
Using CR 8.5:
I have the following:
detail section (suppressed)
group section which have sum(sales), sum(profit)
I would like the user to select sort by sales ascending, sales descending, porfit ascending, profit descending. Is it possible via parameters (I am aware of TOP N, but cannot put it as a parameter)
Thank you
dré
 
Perhaps build 4 formulas to be used as the groups, 2 with ascending, 2 with descending, and insert them all into the report.

Now set/suppress them according to the parameter.

I know, it's ugly too, but it'll work ;)

-k kai@informeddatadecisions.com
 
-k:
Good one -k, I will try it monday monrning and will let you know.
Also How can I have top 25, 30 40 wihout using top n. I tried to have a counter but I am having a little bit of difficulties counting group. (I know in this sequence I have to have same counter for each group). Any head start. thanks :)
dré
 
With a numnber it is easy as if you reverse the sign, the sort sequence is reversed. If original sequence of numeric field is 3,7,12 then by doing a negate you will get your records sorted -12, -7, -3. Use customise group name to display the original field as the group jsut to get the display right.

So you can use a parameter to create your sort field...
if {?sort}="Asc" then {table.sales}
else - {table.sales}

The same can be done with dates, but my question is how can you do this for a string? What formula will create a reserve sorted string? Editor and Publisher of Crystal Clear
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top