# A number of currency amount is required here.

Hi,

I'm trying to calculate 10% of my site delivery charge which is tax component but CR is having difficulty via the formula producing the result.

Formula
if {Sheet1_.ZFR2 - Site Delivery} <=0 then "0"
else ({@sdelivery-unit-cost} *.10)

when I check the formula, it highlight this   (@sdelivery-unit-cost}  as part of the error in the formula

@sdelivery-unit-cost is....
if ({Sheet1_.ZFR2 - Site Delivery}) <=0 then ""
else {@sdelivery-sum}

@sdelivery-sum is....
CStr(sum ({Sheet1_.ZFR2 - Site Delivery}, {Sheet1_.Bill#Doc#}),2,'')

Any idea how to fix this?

error.bmp
Crystal Reports

Last Comment
mcse2007
Kurt Reinhardt

THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
mcse2007

what would be the fix formula then?
SOLUTION
Mike McCracken

THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
There is no one fix formula.  You'd have to change all the dependencies.  You'd first change sdelivery-sum by not converting it to a string.

``````sum ({Sheet1_.ZFR2 - Site Delivery}, {Sheet1_.Bill#Doc#})
``````

You'd then have to change sdelivery-unit-cost to be something like:

``````if ({Sheet1_.ZFR2 - Site Delivery}) <=0 then 0
else {@sdelivery-sum}//this formula is a number
``````

You'd then change the final formula to:

``````if {Sheet1_.ZFR2 - Site Delivery} <=0 then 0
else ({@sdelivery-unit-cost} *.10)
``````

Before you change anything, however, you need to ascertain why you're using strings in the first place.  Is there a specific business rule you're trying to meet? Is this change going to break something else in the report?

~Kurt
mcse2007

Beautiful. That worked.

Thanks mlmcc...when I'm visiting UK next time, i'll buy you a drink. :-)
Mike McCracken

Since rhinok pointed out the error and then gave a solution to fix all the formulas he desires a majority of the credit for the solution

mlmcc
mcse2007

rhinok deserves some points here, that's for sure...sorry mate.
Crystal Reports

Crystal Reports is a business intelligence application from SAP SE. It is used to graphically design data connections and report layouts from a wide range of data sources including Excel spreadsheets, Oracle, SQL Server databases and Access databases, BusinessObjects Enterprise business views, and local file-system information. Report designers can place fields from these sources on the report design surface, and can also deploy them in custom formulas (using either BASIC or Crystal's own syntax), which are then placed on the design surface. Crystal Reports also supports subreports, graphing, and a limited amount of GIS functionality.

36K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts

TRUSTED BY