简体   繁体   中英

How to add formula on Crystal report fields

Below is my crystal report ,I want to perform Formula something like below ,as I am new to crystal report how can I do this ?

if (`Fee_unit`==Percent)
{
FeeTotal = (`Fee` divided by 100) * `Number of patients`;
}
else
{
FeeTotal = `Fee` *  `Number of patients`;
}

水晶报表

In Field Explorer -> Formula-> New Formula.

From the drop down above select Basic Syntax.

If {TableName.FeeUnit} = {TableName.Percent} Then // Assuming you have FeeUni and Percent as column in TableName table. Drag drop the two and wrap with the code
    formula=({TableName.Fee}/100)*{TableName.Patients}  // formula here is a keyword

Else 
    formula={TableName.Fee}*{TableName.Patients}  
End If

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