30. April 2013 09:33
>>>>Item Ledger Entry - OnAfterGetRecord()<<<<
IF grecCustomer.GET("Source No.") THEN
gtxtCustomerName := grecCustomer.Name
ELSE
gtxtCustomerName := '';
gdecDeckungsbetrag := "Sales Amount (Actual)" + "Cost Amount (Actual)";
gdecDeckungsbetragKat += "Sales Amount (Actual)" + "Cost Amount (Actual)";
gdecDeckungsbetragGes += "Sales Amount (Actual)" + "Cost Amount (Actual)";
gdecSalesAmountKat += "Sales Amount (Actual)";
gdecSalesAmountGes += "Sales Amount (Actual)";
gdecCostAmountKat += "Cost Amount (Actual)";
gdecCostAmountGes += "Cost Amount (Actual)";
IF "Sales Amount (Actual)" <> 0 THEN
gdecProzent := ROUND((("Sales Amount (Actual)" + "Cost Amount (Actual)") / ABS("Sales Amount (Actual)") * 100),0.01)
ELSE
gdecProzent := 0;
>>>>Item Ledger Entry - OnPostDataItem()<<<<
IF gdecSalesAmountKat <> 0 THEN
gdecProzentKat := ROUND(((gdecSalesAmountKat + gdecCostAmountKat) / ABS(gdecSalesAmountKat) * 100),0.01)
ELSE
gdecProzentKat := 0;
30. April 2013 09:46
30. April 2013 09:58
30. April 2013 10:01
Sipa hat geschrieben:da ich so keine Null-Division abfangen kann ohne aufwändigen Code in Visual-Studio zu bauen.
30. April 2013 10:08
30. April 2013 10:15
..grade so weit bin froh zu sein die syntax von iif zu kapieren
=IIF(VAR=0,0,VAR2/VAR)
30. April 2013 10:18
=iif(SUM(Fields!Sales_Amount_Actual.Value) = 0, 0, (SUM(Fields!Sales_Amount_Actual.Value) + SUM(Fields!Cost_Amount_Actual.Value)) / ABS(SUM(Fields!Sales_Amount_Actual.Value)) * 100)