Print Page | Close Window

Display zero count

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=10574
Printed Date: 26 Apr 2024 at 5:18pm


Topic: Display zero count
Posted By: bolson
Subject: Display zero count
Date 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.



Replies:
Posted By: DBlank
Date 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



Posted By: bolson
Date 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.


Posted By: DBlank
Date 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


Posted By: DBlank
Date Posted: 19 Jul 2010 at 10:38am
or are you using a sub report?


Posted By: bolson
Date 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.


Posted By: DBlank
Date 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)


Posted By: crystalsonic
Date Posted: 24 Sep 2013 at 5:43am
what if you are using a summary field in the subereport to calculate a count?


Posted By: DBlank
Date 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



Print Page | Close Window