문제

I am writing a simple formula in crystal reports. What I am trying to do is to calculate a total based on some conditions, store the result in a shared numberVar, then return the result. However, I get an error right after my else

WhilePrintingRecords;
EvaluateAfter({@Share_Hundred_Percent});
EvaluateAfter({@Less_Commission});
EvaluateAfter({@Payment_NICL});
EvaluateAfter({@Payment_PRCL});

Shared numberVar sumNetPayable;
numberVar result;

if({Command.GENCLIENTCODE}=990) then
    result:= {@Share_Hundred_Percent} - {@Less_Commission} + {@Payment_PRCL};
else
    result:= {@Share_Hundred_Percent} - {@Less_Commission};

sumNetPayable := sumNetPayable + result;

result

The remaining text does not appear to be part of the formula

도움이 되었습니까?

해결책

Try this. Remove semicolon for Then in If

WhilePrintingRecords;
EvaluateAfter({@Share_Hundred_Percent});
EvaluateAfter({@Less_Commission});
EvaluateAfter({@Payment_NICL});
EvaluateAfter({@Payment_PRCL});

Shared numberVar sumNetPayable;
numberVar result;

if({Command.GENCLIENTCODE}=990) then
    result:= {@Share_Hundred_Percent} - {@Less_Commission} + {@Payment_PRCL}
else
    result:= {@Share_Hundred_Percent} - {@Less_Commission};

sumNetPayable := sumNetPayable + result;

result
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top