| Author |
Message |
peijay
Newbie
Joined: 08 Jun 2012
Online Status: Offline
Posts: 4
|

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 Logged |
|
|
|
Gurbs
Senior Member
Joined: 16 Feb 2012
Location: Ireland
Online Status: Offline
Posts: 216
|

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 Logged |
|
hilfy
Admin Group
Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
|

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 Logged |
|
peijay
Newbie
Joined: 08 Jun 2012
Online Status: Offline
Posts: 4
|

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 Logged |
|
Gurbs
Senior Member
Joined: 16 Feb 2012
Location: Ireland
Online Status: Offline
Posts: 216
|

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 Logged |
|
rkrowland
Senior Member
Joined: 20 Dec 2011
Location: England
Online Status: Offline
Posts: 259
|

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 Logged |
|
peijay
Newbie
Joined: 08 Jun 2012
Online Status: Offline
Posts: 4
|

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 Logged |
|
peijay
Newbie
Joined: 08 Jun 2012
Online Status: Offline
Posts: 4
|

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 Logged |
|
|
|