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!

Underlaying detail lines

Status
Not open for further replies.

sixtoesofdean

Programmer
Nov 6, 2002
26
GB
Hi

Is there a bug with Crystal's underlay function? I've used it in plenty of situations before without error, so assume its something I'm doing wrong. Here goes at an explanation:

I have a table that returns a list of users, their department and roles for each department. The table is infact a view that brings the 3 entities together as a cartesian product. Not very good, but easy to work with.

For each user I want to show which departments they belong to, and which roles they have. Note there is no real link between department and rule.

I've added a couple of formula which remove the duplicate roles and deparments via using them on the dept and role fields suppress events.

This all seems to work fine, except when I come to underlay the two detail lines I'm using to display dept and role;

In cases where I have multiple roles, I'm still getting blank lines in my department column, and therein lies the problem.

I'm also suppressing any blank lines but this doesn't quite give the desired result.

The only other thing I can add is that I'm grouping only on the user name, and sorting on user, dept, role.

Anyone any ideas ?

Thanks in advance
 
I know what you mean. You might be better off adding the roles in a subreport which you could place in the user group header (linking on userID), with the user group header set to underlay following sections. This should give you a display like:

User1 DeptA Role1
DeptB Role2
Role3
User2 DeptA Role1
DeptB Role2
DeptC

-LB
 
Thanks for the suggestion. I did infact end up using a couple of sub-reports to get the effect. As mentioned, there is no real link between role and department, so although all the information is presented in one view it is semantically confusing. In this case a user simply has a set of roles assigned to them, and a set of departments; the roles do not vary from department to department, so if I have a user who belongs to dept-a, dept-b, and for arguments sake has roles 'dealer', 'administrator', 'first aider', 'tea maker', the view returns

dept-a dealer
dept-a administrator
dept-a first aider
dept-a tea maker
dept-b dealer
dept-b administrator
dept-b first aider
dept-b teamaker

... as you've shown. However what I'd like to see is:

User: Fred
-----------
Dept-A dealer
Dept-B administrator
first aider
tea maker

The only way I could get that effect is with the sub-reports. I'm not sure whether to regard Crystal's underlay functionality as buggy here since I can half see why it refuses to list departments underneath one another; the record pointer moves on to the next record, and showing information for the current row on the previous line (which is what I want!!) could also be inteptreted as semantically confusing. It would perhaps be nice if Crystal allowed you tinker with its underlay semantics (i.e. allow you to ignore the fact that in 9/10 cases you's want all underlaying to scope to the current row (detail line) and not previous rows; however for 1/10 case (like mine) it would be nice to change that.

Thanks for your reply anyhow; it did help!

Regards

CJ
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top