Crystal Reports Shared CurrencyVar breaks formula when passing negative number

I have multiple subreports passing shared numbervar and currencyvar...
The Billing Rate subreport's @Rate formula is the following:
if {@hours}>0
then ({Orders.OrderTotal}-({@materials}+{@misccost}))/{@hours}
else 100


@materials is a shared currencyvar
@misccost is a shared currencyvar
@hours is a shared numbervar

The subreport and formula work fine until @misccost is a negative number (from debit memo)...

Is there a method of formatting the @misccost shared currencyvar so that the negative will allow the @Rate value to be displayed? Or is something else breaking the formula?

See attached for reference.
Subreport.pdf
LVL 9
Lee IngallsDirector of IT/TS, Quality and FinanceAsked:
Who is Participating?
 
Lee IngallsConnect With a Mentor Director of IT/TS, Quality and FinanceAuthor Commented:
What ultimately fixed the report was rewriting the Main Report @Material Costs formula to include NULL handling.

@Material Costs
from:
Sum ({@Misc Costs})+({@poval})

to:
IF ISNULL ({@Misc Costs})
THEN {@POVal}
ELSE IF ISNULL ({@POVal})
THEN ({@Misc Costs})
ELSE ({@Misc Costs})+{@POVal}

Whenever @Misc Costs was 0.00 my Main Report formulas:
@Material Costs
@Total Costs
@Gross Profit
@Billing Rate
all displayed NULL. Once I handled the NULL's each dependent value was passed to the subsequent formula.

I wouldn't have been able to see this until your suggestion to check the Report Options "Exceptions For NULL option to DEFAULT FOR NULL". How do you suggest I award the solutions points?

Regards, BudELee
0
 
mlmccConnect With a Mentor Commented:
The negative value is not (at least I don't think it is) breaking the formula.

Is the Order Amount NULL?

Try setting the Exceptions For NULL option to DEFAULT FOR NULL

mlmcc
0
 
Lee IngallsDirector of IT/TS, Quality and FinanceAuthor Commented:
Thanks mlmcc,

I set the "Exceptions For NULL option to DEFAULT FOR NULL" for the main and subreports; though it did not necessarily fixed the problem it did display 0.00 rather than nothing. That gave me an indication where to look. At that point I started breaking down each formula to see where they were failing.
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
mlmccCommented:
Are you able to fix the issues?

mlmcc
0
 
mlmccCommented:
ANy way you desire.  Since my suggestion helped you can select it as assisted solution with your comment as the solution.  I believe you can award partial points if you desire.

mlmcc
0
 
Lee IngallsDirector of IT/TS, Quality and FinanceAuthor Commented:
mlmcc's suggestion, though not solving the problem directly lead to my being able to solve it.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.