2013-10-06 89 views
1

以下是我的水晶报表,我想执行下面的公式,因为我是水晶报表新手,我该怎么做?如何在水晶报表字段上添加公式

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

Crystal report

回答

2

在字段资源管理器 - >式 - >新公式。

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 
+0

Fee_Unit是表名,但百分比是它的值,所以我该如何做到这一点 – Durga