Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Group Summary on Header Post Reply Post New Topic
Page  of 2 Next >>
Author Message
manug87
Newbie
Newbie


Joined: 14 Apr 2010
Online Status: Offline
Posts: 7
Quote manug87 Replybullet Topic: Group Summary on Header
     Posted: 29 Sep 2010 at 11:55pm
Hi Reader,

I am relatively new to reporting (Crystal Reports 11.5). I am stuck at a particular situation and there are no experts around. :(

Let me explain the situation. I have a list of users and their status across departments
UserID       Status               Department
01          Active               IT
01          Active               Docs
02          Active               IT
03          Suspended             Docs
04          Leave                 Docs

I need to find the distinct count of number of users having a particular status. In this case,
Active       - 2
Suspended    - 1
Leave        - 1

The result set is grouped by Status and User.
I tried using doing a right-click -> insert -> summary and did a distinct count at Status group level. This gives the required result set but this is present at the group header.

I want this summary to be present in the report header and I don't seem to be able to do this. When I copy it there, the result set gets weird. Please help me out. Or let me know if this is to be done any other way.

Thanks [COLOR=red]COLOR=red[/COLOR]
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 30 Sep 2010 at 3:28am
group by status and insert a distinctcount of userid at that group level
DistinctCount(table.userid,table.status)
IP IP Logged
manug87
Newbie
Newbie


Joined: 14 Apr 2010
Online Status: Offline
Posts: 7
Quote manug87 Replybullet Posted: 30 Sep 2010 at 8:10am
Thanks DBlank.
Actually, I already tried this and it does give me the required result in the group header. But as I mentioned, I require this DistinctCount result to be present in the Report Header and when I move this to Report Header, it is not giving me proper results.


Edited by manug87 - 30 Sep 2010 at 8:11am
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 30 Sep 2010 at 9:10am
Use a CrossTab
row =Status
summarized field=distinctcount of userid
you can alter the lines and supress totals as desired
IP IP Logged
manug87
Newbie
Newbie


Joined: 14 Apr 2010
Online Status: Offline
Posts: 7
Quote manug87 Replybullet Posted: 30 Sep 2010 at 10:59pm
Thanks a lot again.

The totals appear perfectly but the look of the cross-tab is not exactly that I require. I want a description to appear in the place where the Status appears in the row.
Is it possible to modify the look in cross-tabs? I mean the row name part of it.
IP IP Logged
manug87
Newbie
Newbie


Joined: 14 Apr 2010
Online Status: Offline
Posts: 7
Quote manug87 Replybullet Posted: 01 Oct 2010 at 2:03am
Ok. Looks like I have figured out how to change those names :). Achieved that using formulas.

I apologize for not putting it forward before, but I have 2 other possible status too - 'Deceased' and 'Retired'. I require to total these 2 along with 'Leave' Status and get that in a single row. Could this be possible to be done with the cross-tabs?
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 01 Oct 2010 at 4:27am
you can create a formula to convert your status field to whatyever you want then use the formula field in the CT instead of the status.field.
Example:
if table.status in ['Deceased','Retired','Leave'] then 'Your description here'
else if table.status='active' then 'your other text here'
else if table.status='suspended' then 'xxx'
else 'xxx'


Edited by DBlank - 01 Oct 2010 at 4:27am
IP IP Logged
manug87
Newbie
Newbie


Joined: 14 Apr 2010
Online Status: Offline
Posts: 7
Quote manug87 Replybullet Posted: 01 Oct 2010 at 6:35am
Wow! Awesome. Worked like a charm. Thanks again.

In the final else clause, when it does not match to any status, it would be great if I could suppress it. I am giving the text as 'Unknown'.

I used this formula in suppress field on the row name:
if CurrentFieldValue='Unknown' then true

But this just suppresses the row name value, but still the count for it is displayed. Is it possible to suppress the entire row?
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 01 Oct 2010 at 8:00am
are you excluding them in the rest of the report?
if so drop them using the select expert. If not try a new post as I think you can supress an entire row in a CT but cannot remember how at the moment nor am I at a machine to look it up.
Sorry.
IP IP Logged
manug87
Newbie
Newbie


Joined: 14 Apr 2010
Online Status: Offline
Posts: 7
Quote manug87 Replybullet Posted: 01 Oct 2010 at 8:19am
This is actually a report for audit purposes. The 'Unknown' status are required in the detail section but must be suppressed in the CT. So select expert cannot be utilized. I have been trying to get this done for the past 2 hours or so, but I am not getting any further ideas.

Please let me know any ideas once you get a chance.
IP IP Logged
Page  of 2 Next >>
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum