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!

Specifying group order

Status
Not open for further replies.

jessieyull

Technical User
Apr 1, 2002
16
US
We are using v7.0 - I am trying to arrange my groups based on a specific order that the user wants.

From the design tab, I right-click on the group (I only have one group header) and select change group.

I selected "in specified order" and went to the 'specified order' tab to select each of my group names and put them in the order I need.

But - when I run the report - it seems to totally ignore this ordering that I just set up. Am I doing it wrong?

When I click on the sort order button, it shows my group first with a -S at the end and then my secondary sort which is on the $amount within the records with the D since its descending. It all looks like it should work. The $amount sort within each group is working correctly.
 
Groups cannot be sorted like records. If you want a grouping on {Table.value1} to be before {Table.value1} then you would make Group1 based on {Table.value1} and Group2 based on {Table.value1} and your report will be sorted that way.

BUT if you want to leave it up to the user as to the sort order of the groups then you base the Group1 and Group2 on formulas not field names

first create a parameter so the user can enter their choice

?ReportSortOrder
Type: string
Description: Type "A" for {Table.value1}/{Table.value2} or
"B" for {Table.value2}/{Table.value1}
Default: A

Now compose your formulas for each group

@Group1

if uppercase({?ReportSortOrder) = "B" then
{Table.value2}
else
{Table.value1};

@Group2

if uppercase({?ReportSortOrder) = "B" then
{Table.value1}
else
{Table.value2};


Now create Groups 1 and 2 based on these formulas. This is a simple case with only 2 possiblities...more complicated formulas can be developed for other situations (more group choices [here must check for duplicate choices]...sometimes you might no want 2 groups so the formula would make the group a constant[ie. no grouping] )

BTW..."Specified Order" sorts / combines values within a group...it doesn't sort groups themselves

Hope this helps

Jim

JimBroadbent@Hotmail.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top