good morning sir,
i want to create top 10 customers by sales,i have worked on it, i am getting 14 customers by sales as an output,but i need only top 10 customers by sales and their total,there by what i have written i am sharing to you,can you please help me
Customer - OnPreDataItem()
Window.OPEN(Text000);
i := 0;
CustAmount.DELETEALL;
CurrReport.CREATETOTALS("Sales (LCY)");
Customer - OnAfterGetRecord()
Window.UPDATE(1,"No.");
CALCFIELDS("Sales (LCY)");
IF ("Sales (LCY)" = 0)THEN
CurrReport.SKIP;
CustAmount.INIT;
CustAmount."Customer No." := "No.";
IF ShowType = ShowType::"Sales (LCY)" THEN BEGIN
CustAmount."Amount (LCY)" := -"Sales (LCY)";
END ELSE BEGIN
CustAmount."Amount 2 (LCY)" := -"Sales (LCY)";
END;
CustAmount.INSERT;
IF (NoOfRecordsToPrint = 0) OR (i < NoOfRecordsToPrint) THEN
i := i + 1
ELSE BEGIN
CustAmount.FIND('+');
CustAmount.DELETE;
END;
IF ISSERVICETIER THEN BEGIN
TotalSales += "Sales (LCY)";
// TotalBalance += "Balance (LCY)";
ChartTypeNo := ChartType;
ShowTypeNo := ShowType;
END;
Pct(Numeral1 : Decimal;Numeral2 : Decimal) : Decimal
IF Numeral2 = 0 THEN
EXIT(0);
EXIT(ROUND(Numeral1 / Numeral2 * 100,0.1));