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

Can I change the Order of my Groups 2

Status
Not open for further replies.

mulema

Technical User
Nov 16, 2002
32
0
0
US
Hi all,
I would like to know how to do this, with a parameter (i.e if its possible at all)
I have a report with two groups GH1, and GH2. I would like to know how, using a parameter, I can have the report change its grouping order to GH2, then GH1. I do not want to suppress any of the groups. Just a way to flip the order of my groupings back and forth.

Thanks.

 
This would depend upon what data types you're grouping by.

Create 2 formulas to use as the group fields instead of the table fields directly:

@Group 1
If {?GRPparm} = "City" then
{table.city}
else
{table.zip}

@Group 2
If {?PrimaryGRPparm} = "City" then
{table.zip}
else
{table.city}

-k
 
to expand a little on SV's post

You must match data type in the conditional formulas

the easiest way is to convert all values to strings

for example let us say you want to group by DATE/STORE or STORE/DATE

then the formula for Group 1 would be

//@Group1 (NOTE: This is a case where WhilePrintingRecords is NOT used)

if {?Parm} = "Date" then
totext{{Table.datefield},"yyyy") // we assume yearly here
else if {?Parm} = "Store" then
{Table.StoreName}
else
//Always have a default for bad parameter entry
totext{{Table.datefield},"yyyy");

For Group 2

//@Group2

if {?Parm} = "Date" then
{Table.StoreName}
else if {?Parm} = "Store" then
totext{{Table.datefield},"yyyy")
else
{Table.StoreName};

hope this helps


Jim Broadbent

The quality of the answer is directly proportional to the quality of the problem statement!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top