简体   繁体   中英

crystal report error “A string is required”

I wrote a formula to calculate the discount percentage in crystal report.I have retrieved the discount amount from the back end and need to get the discount percentage through this. Disc% = Discount Value/(Quantity*Price) * 100 quantity and price also I got from the back end.my formula is,

IF(({row.DISCOUNT})<>0) then(({@discVal})/( ({@quantity}) * ({@price}) * 100)) else 0

I'm new to this.Therefore please help.

this is the error

Perhaps your {row.DISCOUNT} is a string rather than a number. Either make sure it's a number or use a Crystal formula to convert it to a number. For example:

cDbl({row.DISCOUNT})

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM