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

goupby with different parameters

Status
Not open for further replies.

iamsiraj

Programmer
Jan 8, 2003
7
US
I have a question related to Crystal Report .
I am trying to carry out <Group by > clause in the designer , and the options are read from the parameters. I will try to explain the issue in terms of query :

Select aaaa,bbbb,cccc,dddd,xxx, yyy from the table
where xxx = “value” and yyy=”Value”
Group by optioin1,option2,option3

Where option1,option2 and option3 are user given values , user gives unique value for each options , the set of values for the option are [‘account’, ’company’, ’description’, ’department’] .
In designer I have created 3 parameters namely option1, option2, option3. and I have inserted 4 “Group by ” headers as Groupby.account, Groupby. company, Groupby. description , Groupby. Department
Based on the values of option1 I am suppressing the groupby headers,
How do I repeat this operation for the other two options and also HOW DO I MAINTIN THE ORDER OF THE OPTINS. i.e I want to perform group by operation as option1(first) and then option2 and then option(3).

Could you please answer to this question at the earliest , looking forward to hear from you.
Kind regards
Siraj
 
Create 3 formulas which use the parm to determine how the report is grouped.

example:

// @group1 formula
if {?option1} = &quot;account&quot; then
{table.account}
else if {?option1} = &quot;company&quot; then
{table.company}
else if {?option1} = &quot;description&quot; then
{table.description}
else if {?option1} = &quot;department&quot; then
{table.department}

Make one for each grouping, and use insert group for each of these formulas.

As for the header, just reference the parm to show what it was grouped by rather than use different headers.

&quot;Grouped by &quot; + {?option1}

-k
kai@informeddatadecisions.com
 
Thank you very much, it has answered my Question
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top