Reputation: 1303
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`;
}
Upvotes: 1
Views: 16466
Reputation:
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
Upvotes: 2