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

Sort first then group

Status
Not open for further replies.

ind123p

Programmer
Sep 28, 2005
62
I am using CR XI

This is what I really want to accomplish.

Sort first then group

If parameter is ascending, sort by compnay Ascending then group by Company Ascending

Company Employee
CompanyA XYZ
CompanyA PQR
CompanyA ABC
Company A 3
CompanyB LMN
CompanyB RST
Company B 2

If parameter is descending, sort by company descending then group by Company descending

CompanyB LMN
CompanyB RST
Company B 2
CompanyA XYZ
CompanyA PQR
CompanyA ABC
Company A 3

MY Problem: Whether ascending or descending I am getting this

Company Employee
CompanyA XYZ
CompanyA PQR
CompanyA ABC
Company A 3
CompanyB LMN
CompanyB RST
Company B 2

I know why.. because the group order is ascending.. I know I have to create a specified order. But I am not able to understand how to go about using the specified order.
 
Folks,

I was able to solve the problem. This is what I did.

I entered the following code in the "Use a Formula as Group Sort order"

if {?sort} ="ASC" then
crAscendingorder
else
crDescendingorder

That did it.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top