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!

Sorting on another field when using hierarchical grouping

Status
Not open for further replies.

dev1212

Programmer
May 11, 2010
117
US
Hi,

I grouped on {table.employee} field and on the report->hierarchical grouping options-> used the parent {table.manager}...

The report appears as

John
Dave
Mike
Lenin
Phil
Jose

I want the report to appear as

John
Lenin
Dave
Mike
Phil
Jose

i.e., based on the level ...

Any solution to this guys...







 
Crystal will only group according to what the data is. You could get the result you want using a subreport for either managers or employees. This will double the processing time, but I see no simpler fix.

[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 11.5 with SQL and Windows XP [yinyang]
 
After setting up the hierarchical grouping, create a formula {@hier#} like this:

HierarchyLevel (GroupingLevel ({table.Employee}))

Place this in the group header section. Then save the report and give it another name. Open the original report and insert the renamed version as a subreport, and add {@hier#} as the linking field, but uncheck "select subreport data based on this field". In the subreport, go into the section->details->suppress->x+2 and enter:

{@hier#} <> {?pm-@hier#}

Suppress all other subreport sections.

In the main report, go into the section expert->group header AND details and enter:

groupnumber > 3//replace 3 with the number of hierarchical levels you have.

Then suppress all FIELDS in the main report, leaving only the subreport results on display. Remove the borders around the sub.

-LB
 
woooooooo..!! sounds like a complex one...

I'll try doing that...

Thanks lbass and Madawc for your reply anyway..

I'll try and let you guys know..
 
lbass..
which section of main report should i insert the subreport into...?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top