Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: Need to report zero amounts too Post Reply Post New Topic
Page  of 2 Next >>
Author Message
dee-jo
Newbie
Newbie


Joined: 29 Apr 2010
Location: United States
Online Status: Offline
Posts: 13
Quote dee-jo Replybullet Topic: Need to report zero amounts too
    Posted: 29 Apr 2010 at 9:42am

I am using @BalanceAccum to sum the transaction total for costs and billings to display on a single line item per cost code.  However, I am not getting anything to display when the amount is zero.  I still need zero amounts to display.  The detail is supressed, with the amounts displayed in the GF2.  Subtotals by division in GF1.

IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 29 Apr 2010 at 11:46am
try changing your formula to 'Use default values for Nulls' instead of 'exceptions for Nulls'
IP IP Logged
dee-jo
Newbie
Newbie


Joined: 29 Apr 2010
Location: United States
Online Status: Offline
Posts: 13
Quote dee-jo Replybullet Posted: 03 May 2010 at 3:30am

I found out how to do this, but now it is giving an error for a field with a ToNumber conversion.  When I print preview after marking "use default values for nulls", then it says The String is Non-numeric, and opens up my ToNumber formula.

IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 03 May 2010 at 3:55am
What is your formula that spits the error?
IP IP Logged
dee-jo
Newbie
Newbie


Joined: 29 Apr 2010
Location: United States
Online Status: Offline
Posts: 13
Quote dee-jo Replybullet Posted: 03 May 2010 at 4:25am
I did fix the errors for the ToNumber.

However, my report is still not returning a value when there are no transactions.  I need it to report all cost codes, even if there were no actual costs.
IP IP Logged
dee-jo
Newbie
Newbie


Joined: 29 Apr 2010
Location: United States
Online Status: Offline
Posts: 13
Quote dee-jo Replybullet Posted: 03 May 2010 at 4:30am
Here is what I'm trying to do:
 
If IsNull({JC_TRANSACTIONS.AMOUNT}) then "0" else ({JC_TRANSACTIONS.AMOUNT})
 
However it tells me a string is required and points to the second ({JC_TRANSACTIONS.AMOUNT}).
 
Every cost code that has had no activity is being skipped on the report, but I need every cost code to print, because it would have revenue and budget associated with it.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 03 May 2010 at 4:36am
Don't use " " around the zero. that is making it a string not a numeric value. 
Note: setting any formula that uses this field to "Use default values for Nulls" already does this function.
 
If IsNull({JC_TRANSACTIONS.AMOUNT}) then 0 else ({JC_TRANSACTIONS.AMOUNT})
IP IP Logged
dee-jo
Newbie
Newbie


Joined: 29 Apr 2010
Location: United States
Online Status: Offline
Posts: 13
Quote dee-jo Replybullet Posted: 03 May 2010 at 4:49am
I'm using the Display NumberVar.  It's still not printing zeros.
 
This is my display:
WhilePrintingRecords;
NumberVar BalanceAccumulator
 
This is my accumulator:
WhilePrintingRecords;
NumberVar BalanceAccumulator := NumberVar
BalanceAccumulator+{@ACTUAL2} - {@BILLED} + 0
 
This is my initializer:
WhilePrintingRecords;
NumberVar BalanceAccumulator := 0;
 
This is my ACTUAL2 formula:
If IsNull({JC_TRANSACTIONS.AMOUNT}) then 0 else ({JC_TRANSACTIONS.AMOUNT})
 
I'm not sure what I'm still doing wrong. 
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 03 May 2010 at 5:17am
What is @billed ?
if that has NULLS that are not addressed it will display nothing as well
IP IP Logged
dee-jo
Newbie
Newbie


Joined: 29 Apr 2010
Location: United States
Online Status: Offline
Posts: 13
Quote dee-jo Replybullet Posted: 03 May 2010 at 6:14am
This is the formula for the @BILLED:
 
if{JC_TRANSACTIONS.CLASS}="16" then {JC_TRANSACTIONS.AMOUNT} else 1
 
I still cannot get the zeros to return.  In this case, I even asked for 1 if there were no class 16 transactions.
 
When I do the initial link of tables I am linking Cost Code Tables (holds budget, contract) and Transactions (holds actual and billed).  I have the Cost Code table on the Left (I want all of those reported) and then the Transaction table on the right with arrows between.  Now I'm questioning if this is correct.
IP IP Logged
Page  of 2 Next >>
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.031 seconds.