Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Showing Blank Groups Post Reply Post New Topic
Author Message
peijay
Newbie
Newbie


Joined: 08 Jun 2012
Online Status: Offline
Posts: 4
Quote peijay Replybullet Topic: Showing Blank Groups
     Posted: 08 Jun 2012 at 7:55am

I'm hoping someone can help me figure this out, as i'm baffled.

I have a report in Crystal Reports XI.  The table named Incident.  I want to display records based on a search for Login ID of "Sam" and "Mark" and display the count of incidents they put in, marking it 0 if there was none.
 
Example being
7 May 2012
 
Mark - 12
Sam - 0
 
Right now, Only Mark shows up.  Sam wont' show up. 
 
Anyone know how I can force it to show Sam and put 0?


Edited by peijay - 08 Jun 2012 at 7:56am
IP IP Logged
Gurbs
Senior Member
Senior Member
Avatar

Joined: 16 Feb 2012
Location: Ireland
Online Status: Offline
Posts: 216
Quote Gurbs Replybullet Posted: 11 Jun 2012 at 1:45am
Do you always want to show all the the users? Or do you select them using parameters?
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 11 Jun 2012 at 5:10am
How is your data set up?  What are the tables you're using?  What is your current selection criteria?
 
-Dell
IP IP Logged
peijay
Newbie
Newbie


Joined: 08 Jun 2012
Online Status: Offline
Posts: 4
Quote peijay Replybullet Posted: 12 Jun 2012 at 9:24am
I wan to show all users all the time, so if there is 0, it shows, if there is 10 it shows.
 
the tables I'm using is incidents, as it's what I want to query.
IP IP Logged
Gurbs
Senior Member
Senior Member
Avatar

Joined: 16 Feb 2012
Location: Ireland
Online Status: Offline
Posts: 216
Quote Gurbs Replybullet Posted: 12 Jun 2012 at 11:30pm
What you could do, is work with a subreport.

Group your report by Users. In the Group footer, show all your clients (the grouped ones).

Then create a subreport where you show your count and all other information you want, per user. Link this report on User ID or something and place it in your Detail sections

Create, in your subreport, a shared variable where you show your count. Place this formula in your subreport.
In your main report, show this shared variable again.
IP IP Logged
rkrowland
Senior Member
Senior Member
Avatar

Joined: 20 Dec 2011
Location: England
Online Status: Offline
Posts: 259
Quote rkrowland Replybullet Posted: 13 Jun 2012 at 12:40am
You could also do this with just a main report with a simple stored proc.
 
Something like;
 
Select
table.loginid,
isnull(x.count,0) as 'Incident Count'
 
from table
 
left join (
select
table.loginid,
count(table.incident) as 'count'
 
from table
 
group by
table.loginid) x
on x.loginid = table.loginid
 
or thereabouts, I'd need more information regarding your database and final uotput to do it precisely.
 
Regards,
Ryan.
IP IP Logged
peijay
Newbie
Newbie


Joined: 08 Jun 2012
Online Status: Offline
Posts: 4
Quote peijay Replybullet Posted: 13 Jun 2012 at 11:14am
Ryan,
 
I appreciate the help a lot.  Where do I put that stored info?
 
Right now, I'm trying to figure out the database.  I thought there was a table named analysts which lists all analysts, but I was wrong so I got a bit of digging to do there.  I'll give the code above a check though.
IP IP Logged
peijay
Newbie
Newbie


Joined: 08 Jun 2012
Online Status: Offline
Posts: 4
Quote peijay Replybullet Posted: 15 Jun 2012 at 8:46am
I was able to figure out a solution thanks to the stored process.
 
I put in the incident count in a running total rather than selection expert.  So the selection expert searched the loginid, the running total did the date and incident count.
 
Thanks for the help!
IP IP Logged
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