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

List Values in Group by Section 1

Status
Not open for further replies.

josephwc

Programmer
Oct 13, 2005
83
US
Crystal 11 Report
Linked to Microsoft Access XP query

In the detail section of this report I have projects listed by person. These projects roll up to a particular client. The detail look something like this

Project Client Hours
ABC Bank One 3
BCD Bank Two 4
CDE Bank Three 5
EDF Bank Two 7
FGH Bank Four 1

The Group is by person. I would like to see the three Client names with the highest hours listed in the person group without repeating Client Names.

For Example

John Smith
Bank One, Bank Two, Bank Three
 
Insert a group on {table.client} and then insert a sum on {table.hours} at the client group level. Then go to report->group sort->client tab->select topN = 3 and sum of {table.hours} descending. Then create three formulas:

//{@reset} for the person group header:
whileprintingrecords;
stringvar top3clients := "";

//{@accum} for the client group header:
whileprintingrecords;
stringvar top3clients := top3clients + {table.client} + ", ";

//{@displ} for the person group footer:
whileprintingrecords;
stringvar top3clients;
left(top3clients,len(top3clients)-2);

Then suppress the client group sections and the detail section.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top