Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: Display zero count Post Reply Post New Topic
Author Message
bolson
Newbie
Newbie


Joined: 19 Jul 2010
Online Status: Offline
Posts: 3
Quote bolson Replybullet Topic: Display zero count
    Posted: 19 Jul 2010 at 10:19am
I am working on a report that counts registrants for a particular event.

Currently we use a parameter that allows for multiple inputs by a job code. the goal of the report is to break down the number of registrants by their job code.

the job codes are in number format, and idea results would be something like this:

JOB CODE                      REGISTRANTS
100                                        22
200                                        0
201                                        5
202                                        0
301                                        18

But the only thing i can get is

JOB CODE                      REGISTRANTS
100                                        22
200                                        5
201                                        18
202                                       
301                                       

I need zero registrants to show on the report. But since the sql doesn't return any registrants with those job codes for the particular event the group feature doesn't know they exist. I just can't for the life of me figure out a way around this. I'm sure this has been done a million times before. Let me know if you need any more information.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 19 Jul 2010 at 10:22am

If you are using a formula to do a count change the formula to use defualt values for Nulls

IP IP Logged
bolson
Newbie
Newbie


Joined: 19 Jul 2010
Online Status: Offline
Posts: 3
Quote bolson Replybullet Posted: 19 Jul 2010 at 10:33am
count(jobcode) doesnt work. It doesn't count anything if nothing is returned. so it doesn't even really know that there were parameters passed in that aren't returned.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 19 Jul 2010 at 10:37am

there has to ea a row with NULL in it in iorder for the job code to appear as your sample does, correct?

if you change the report setting to use default values for null or in a formula field you can change that setting for only that formua.it will return 0 instead of nothing


Edited by DBlank - 19 Jul 2010 at 10:39am
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 19 Jul 2010 at 10:38am
or are you using a sub report?
IP IP Logged
bolson
Newbie
Newbie


Joined: 19 Jul 2010
Online Status: Offline
Posts: 3
Quote bolson Replybullet Posted: 19 Jul 2010 at 10:48am
since the codes are displayed in multiple areas on the report, I use one subreport to show that and one to show the total registrants.

Also since the report covers multiple events I pretty much have to use a subreport to get the registrants for each event.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 19 Jul 2010 at 11:27am
ah, that is obviously different.
I assume you that the value under count is from a subreport linked on a job code.
You can still do what I was suggesting or change your formula in the sub report
if isnull(field) then 0 else count(field)
IP IP Logged
crystalsonic
Groupie
Groupie


Joined: 26 Jan 2012
Online Status: Offline
Posts: 46
Quote crystalsonic Replybullet Posted: 24 Sep 2013 at 5:43am
what if you are using a summary field in the subereport to calculate a count?
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 24 Sep 2013 at 5:52am
in the report set up you can set it to use defualot values for all suammry types.
otherwise find each source and set the defaults inside the formual editor for each item to use defualts for nulls
IP IP Logged
Post Reply Post New Topic
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



This page was generated in 0.016 seconds.